Versions in this module Expand all Collapse all v0 v0.8.0 Nov 20, 2022 Changes in this version + var ErrIdentityNotExist = errors.New("identity doesn't exist") + var ErrMultipleIdentitiesSet = errors.New("multiple user identities set") + var ErrNoIdentitySet = errors.New(...) + var ErrNonFastForwardMerge = errors.New("non fast-forward identity merge") + func Fetch(repo repository.Repo, remote string) (string, error) + func GetUserIdentityId(repo repository.Repo) (entity.Id, error) + func IsUserIdentitySet(repo repository.Repo) (bool, error) + func ListLocalIds(repo repository.Repo) ([]entity.Id, error) + func MergeAll(repo repository.ClockedRepo, remote string) <-chan entity.MergeResult + func NewErrMultipleMatch(matching []entity.Id) *entity.ErrMultipleMatch + func NewErrMultipleMatchIdentity(matching []entity.Id) *entity.ErrMultipleMatch + func Pull(repo repository.ClockedRepo, remote string) error + func Push(repo repository.Repo, remote string) (string, error) + func ReadAllLocal(repo repository.ClockedRepo) <-chan StreamedIdentity + func ReadAllRemote(repo repository.ClockedRepo, remote string) <-chan StreamedIdentity + func RemoveIdentity(repo repository.ClockedRepo, id entity.Id) error + func SetUserIdentity(repo repository.RepoConfig, identity *Identity) error + type Identity struct + func GetUserIdentity(repo repository.Repo) (*Identity, error) + func NewFromGitUser(repo repository.ClockedRepo) (*Identity, error) + func NewIdentity(repo repository.RepoClock, name string, email string) (*Identity, error) + func NewIdentityFull(repo repository.RepoClock, name string, email string, login string, ...) (*Identity, error) + func ReadLocal(repo repository.Repo, id entity.Id) (*Identity, error) + func ReadRemote(repo repository.Repo, remote string, id string) (*Identity, error) + func (i *Identity) AvatarUrl() string + func (i *Identity) Commit(repo repository.ClockedRepo) error + func (i *Identity) CommitAsNeeded(repo repository.ClockedRepo) error + func (i *Identity) DisplayName() string + func (i *Identity) Email() string + func (i *Identity) Id() entity.Id + func (i *Identity) ImmutableMetadata() map[string]string + func (i *Identity) IsProtected() bool + func (i *Identity) Keys() []*Key + func (i *Identity) LastModification() timestamp.Timestamp + func (i *Identity) LastModificationLamports() map[string]lamport.Time + func (i *Identity) Login() string + func (i *Identity) MarshalJSON() ([]byte, error) + func (i *Identity) Merge(repo repository.Repo, other *Identity) (bool, error) + func (i *Identity) MutableMetadata() map[string]string + func (i *Identity) Mutate(repo repository.RepoClock, f func(orig *Mutator)) error + func (i *Identity) Name() string + func (i *Identity) NeedCommit() bool + func (i *Identity) SetMetadata(key string, value string) + func (i *Identity) SigningKey(repo repository.RepoKeyring) (*Key, error) + func (i *Identity) UnmarshalJSON(data []byte) error + func (i *Identity) ValidKeysAtTime(clockName string, time lamport.Time) []*Key + func (i *Identity) Validate() error + type IdentityStub struct + func (IdentityStub) AvatarUrl() string + func (IdentityStub) DisplayName() string + func (IdentityStub) Email() string + func (IdentityStub) IsProtected() bool + func (IdentityStub) Keys() []*Key + func (IdentityStub) Login() string + func (IdentityStub) Name() string + func (IdentityStub) ValidKeysAtTime(_ string, _ lamport.Time) []*Key + func (IdentityStub) Validate() error + func (i *IdentityStub) Id() entity.Id + func (i *IdentityStub) LastModification() timestamp.Timestamp + func (i *IdentityStub) LastModificationLamports() map[string]lamport.Time + func (i *IdentityStub) MarshalJSON() ([]byte, error) + func (i *IdentityStub) NeedCommit() bool + func (i *IdentityStub) SigningKey(repo repository.RepoKeyring) (*Key, error) + func (i *IdentityStub) UnmarshalJSON(data []byte) error + type Interface interface + AvatarUrl func() string + DisplayName func() string + Email func() string + IsProtected func() bool + Keys func() []*Key + LastModification func() timestamp.Timestamp + LastModificationLamports func() map[string]lamport.Time + Login func() string + Name func() string + NeedCommit func() bool + SigningKey func(repo repository.RepoKeyring) (*Key, error) + ValidKeysAtTime func(clockName string, time lamport.Time) []*Key + Validate func() error + func UnmarshalJSON(raw json.RawMessage) (Interface, error) + type Key struct + func GenerateKey() *Key + func (k *Key) Clone() *Key + func (k *Key) MarshalJSON() ([]byte, error) + func (k *Key) PGPEntity() *openpgp.Entity + func (k *Key) Private() *packet.PrivateKey + func (k *Key) Public() *packet.PublicKey + func (k *Key) UnmarshalJSON(data []byte) error + func (k *Key) Validate() error + type Mutator struct + AvatarUrl string + Email string + Keys []*Key + Login string + Name string + type SimpleResolver struct + func NewSimpleResolver(repo repository.Repo) *SimpleResolver + func (r *SimpleResolver) Resolve(id entity.Id) (entity.Interface, error) + type StreamedIdentity struct + Err error + Identity *Identity + type StubResolver struct + func NewStubResolver() *StubResolver + func (s *StubResolver) Resolve(id entity.Id) (entity.Interface, error)