Versions in this module Expand all Collapse all v1 v1.33.0 Aug 7, 2022 v1.32.0 Aug 7, 2022 v1.31.0 Aug 7, 2022 v1.30.0 Aug 7, 2022 v1.29.0 Aug 7, 2022 Changes in this version + var ErrNoIntersection = errors.New("no intersection") + var ErrNoSuchKey = errors.New("key not found") + func Create(storage Chonk, state State, signer Signer) (*Authority, AUM, error) + type AUM struct + DisablementSecret []byte + Key *Key + KeyID tkatype.KeyID + MessageKind AUMKind + Meta map[string]string + PrevAUMHash []byte + Signatures []tkatype.Signature + State *State + Votes *uint + func (a *AUM) Hash() AUMHash + func (a *AUM) Parent() (h AUMHash, ok bool) + func (a *AUM) Serialize() []byte + func (a *AUM) StaticValidate() error + func (a *AUM) Weight(state State) uint + func (a AUM) SigHash() tkatype.AUMSigHash + type AUMHash [blake2s.Size]byte + type AUMKind uint8 + const AUMAddKey + const AUMCheckpoint + const AUMDisableNL + const AUMInvalid + const AUMNoOp + const AUMRemoveKey + const AUMUpdateKey + func (k AUMKind) String() string + type Authority struct + func Bootstrap(storage Chonk, bootstrap AUM) (*Authority, error) + func Open(storage Chonk) (*Authority, error) + func (a *Authority) Head() AUMHash + func (a *Authority) Inform(updates []AUM) error + func (a *Authority) MissingAUMs(remoteOffer SyncOffer) ([]AUM, error) + func (a *Authority) NewUpdater(signer Signer) *UpdateBuilder + func (a *Authority) SyncOffer() (SyncOffer, error) + func (a *Authority) VerifySignature(nodeKeySignature tkatype.MarshaledSignature) error + type Chonk interface + AUM func(hash AUMHash) (AUM, error) + ChildAUMs func(prevAUMHash AUMHash) ([]AUM, error) + CommitVerifiedAUMs func(updates []AUM) error + Heads func() ([]AUM, error) + LastActiveAncestor func() (*AUMHash, error) + SetLastActiveAncestor func(hash AUMHash) error + type FS struct + func ChonkDir(dir string) (*FS, error) + func (c *FS) AUM(hash AUMHash) (AUM, error) + func (c *FS) ChildAUMs(prevAUMHash AUMHash) ([]AUM, error) + func (c *FS) CommitVerifiedAUMs(updates []AUM) error + func (c *FS) Heads() ([]AUM, error) + func (c *FS) LastActiveAncestor() (*AUMHash, error) + func (c *FS) SetLastActiveAncestor(hash AUMHash) error + type Key struct + Kind KeyKind + Meta map[string]string + Public []byte + Votes uint + func (k Key) Clone() Key + func (k Key) ID() tkatype.KeyID + func (k Key) StaticValidate() error + type KeyKind uint8 + const Key25519 + const KeyInvalid + func (k KeyKind) String() string + type Mem struct + func (c *Mem) AUM(hash AUMHash) (AUM, error) + func (c *Mem) ChildAUMs(prevAUMHash AUMHash) ([]AUM, error) + func (c *Mem) CommitVerifiedAUMs(updates []AUM) error + func (c *Mem) Heads() ([]AUM, error) + func (c *Mem) LastActiveAncestor() (*AUMHash, error) + func (c *Mem) Orphans() ([]AUM, error) + func (c *Mem) SetLastActiveAncestor(hash AUMHash) error + type NodeKeySignature struct + KeyID []byte + Pubkey []byte + SigKind SigKind + Signature []byte + func (s *NodeKeySignature) Serialize() tkatype.MarshaledSignature + type SigKind uint8 + const SigDirect + const SigInvalid + func (s SigKind) String() string + type Signer interface + SignAUM func(tkatype.AUMSigHash) ([]tkatype.Signature, error) + type State struct + DisablementSecrets [][]byte + Keys []Key + LastAUMHash *AUMHash + func (s State) Clone() State + func (s State) GetKey(key tkatype.KeyID) (Key, error) + type SyncOffer struct + Ancestors []AUMHash + Head AUMHash + type UpdateBuilder struct + func (b *UpdateBuilder) AddKey(key Key) error + func (b *UpdateBuilder) Finalize() ([]AUM, error) + func (b *UpdateBuilder) RemoveKey(keyID tkatype.KeyID) error + func (b *UpdateBuilder) SetKeyMeta(keyID tkatype.KeyID, meta map[string]string) error + func (b *UpdateBuilder) SetKeyVote(keyID tkatype.KeyID, votes uint) error