interface.go

 1package identity
 2
 3import (
 4	"github.com/MichaelMure/git-bug/util/lamport"
 5)
 6
 7type Interface interface {
 8	Name() string
 9	Email() string
10	Login() string
11	AvatarUrl() string
12
13	// Keys return the last version of the valid keys
14	Keys() []Key
15
16	// ValidKeysAtTime return the set of keys valid at a given lamport time
17	ValidKeysAtTime(time lamport.Time) []Key
18
19	// DisplayName return a non-empty string to display, representing the
20	// identity, based on the non-empty values.
21	DisplayName() string
22
23	// Match tell is the Person match the given query string
24	Match(query string) bool
25
26	// Validate check if the Identity data is valid
27	Validate() error
28
29	// IsProtected return true if the chain of git commits started to be signed.
30	// If that's the case, only signed commit with a valid key for this identity can be added.
31	IsProtected() bool
32}