aboutsummaryrefslogtreecommitdiffstats
path: root/identity/interface.go
diff options
context:
space:
mode:
authorMichael Muré <michael.mure@consensys.net>2018-11-21 18:56:12 +0100
committerMichael Muré <batolettre@gmail.com>2019-03-01 22:35:36 +0100
commitfeab9412dffe5772048aad29893c4cb01d566387 (patch)
treeb7bc9751f2ebdf8d41f5621bbf372eaf7625c4b9 /identity/interface.go
parent0aefae6fcca5786f2c898029c3d6282f760f2c63 (diff)
downloadgit-bug-feab9412dffe5772048aad29893c4cb01d566387.tar.gz
WIP identity in git
Diffstat (limited to 'identity/interface.go')
-rw-r--r--identity/interface.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/identity/interface.go b/identity/interface.go
new file mode 100644
index 00000000..14287655
--- /dev/null
+++ b/identity/interface.go
@@ -0,0 +1,30 @@
+package identity
+
+import "github.com/MichaelMure/git-bug/util/lamport"
+
+type Interface interface {
+ Name() string
+ Email() string
+ Login() string
+ AvatarUrl() string
+
+ // Login return the last version of the valid keys
+ Keys() []Key
+
+ // ValidKeysAtTime return the set of keys valid at a given lamport time
+ ValidKeysAtTime(time lamport.Time) []Key
+
+ // DisplayName return a non-empty string to display, representing the
+ // identity, based on the non-empty values.
+ DisplayName() string
+
+ // Match tell is the Person match the given query string
+ Match(query string) bool
+
+ // Validate check if the Identity data is valid
+ Validate() error
+
+ // IsProtected return true if the chain of git commits started to be signed.
+ // If that's the case, only signed commit with a valid key for this identity can be added.
+ IsProtected() bool
+}