Documentation ¶
Index ¶
- Constants
- Variables
- func GetHashes(data []byte) []crypto.Hash
- func GetTokens(data []byte) []crypto.Token
- func IsAxeNonVoid(action []byte) bool
- func Kind(data []byte) byte
- func NewFileHashVaultFromBytes(filePath, name string, data []byte) *hashVault
- func NewHashVault(name string, epoch uint64, bitsForBucket int64, dataPath string) *hashVault
- func NewMemoryHashVaultFromBytes(name string, data []byte) *hashVault
- func NewStateFromBytes(datapath string) social.StateFromBytes[*Mutations, *MutatingState]
- type ActionValidator
- type GrantPowerOfAttorney
- type JoinNetwork
- type KeyExchange
- type MutatingState
- func (s *MutatingState) HasHandle(handle string) bool
- func (s *MutatingState) HasMember(token crypto.Token) bool
- func (m *MutatingState) Mutations() *Mutations
- func (s *MutatingState) PowerOfAttorney(token, attorney crypto.Token) bool
- func (s *MutatingState) SetNewGrantPower(token, attorney crypto.Token) bool
- func (s *MutatingState) SetNewMember(token crypto.Token, handle string) bool
- func (s *MutatingState) SetNewRevokePower(token, attorney crypto.Token) bool
- func (v *MutatingState) Validate(data []byte) bool
- type Mutations
- type RevokePowerOfAttorney
- type State
- func (s *State) Checksum() crypto.Hash
- func (s *State) ChecksumPoint() crypto.Hash
- func (s *State) Clone() chan social.Stateful[*Mutations, *MutatingState]
- func (s *State) CloneAsync() chan *State
- func (s *State) HasHandle(handle string) bool
- func (s *State) HasMember(token crypto.Token) bool
- func (s *State) Incorporate(mutations *Mutations)
- func (s *State) PowerOfAttorney(token, attorney crypto.Token) bool
- func (s *State) Recover() error
- func (s *State) Serialize() []byte
- func (s *State) Shutdown()
- func (s *State) Validator(mutations ...*Mutations) *MutatingState
- type UpdateInfo
- type Void
Constants ¶
View Source
const ( VoidType byte = iota JoinNetworkType UpdateInfoType GrantPowerOfAttorneyType RevokePowerOfAttorneyType Invalid )
Variables ¶
View Source
var AxeProtocolCode = [4]byte{1, 0, 0, 0}
Functions ¶
func IsAxeNonVoid ¶
iisAxeNonVoid checks if a byte array has the header of an axé action different from the void action. It does not try to parse the instruction, so there is no guarantee that the byte array is a valid axé action.
func NewHashVault ¶
func NewStateFromBytes ¶
func NewStateFromBytes(datapath string) social.StateFromBytes[*Mutations, *MutatingState]
Types ¶
type ActionValidator ¶
type GrantPowerOfAttorney ¶
type GrantPowerOfAttorney struct { Epoch uint64 Author crypto.Token Attorney crypto.Token Fingerprint []byte Signature crypto.Signature }
func ParseGrantPowerOfAttorney ¶
func ParseGrantPowerOfAttorney(data []byte) *GrantPowerOfAttorney
func (*GrantPowerOfAttorney) Kind ¶
func (g *GrantPowerOfAttorney) Kind() byte
func (*GrantPowerOfAttorney) Serialize ¶
func (g *GrantPowerOfAttorney) Serialize() []byte
func (*GrantPowerOfAttorney) Sign ¶
func (g *GrantPowerOfAttorney) Sign(pk crypto.PrivateKey)
func (*GrantPowerOfAttorney) Tokens ¶
func (g *GrantPowerOfAttorney) Tokens() []crypto.Token
func (*GrantPowerOfAttorney) Validate ¶
func (g *GrantPowerOfAttorney) Validate(v ActionValidator) bool
type JoinNetwork ¶
type JoinNetwork struct { Epoch uint64 Author crypto.Token Handle string Details string Signature crypto.Signature }
func ParseJoinNetwork ¶
func ParseJoinNetwork(data []byte) *JoinNetwork
func (*JoinNetwork) Kind ¶
func (j *JoinNetwork) Kind() byte
func (*JoinNetwork) Serialize ¶
func (j *JoinNetwork) Serialize() []byte
func (*JoinNetwork) Sign ¶
func (j *JoinNetwork) Sign(key crypto.PrivateKey)
func (*JoinNetwork) Tokens ¶
func (j *JoinNetwork) Tokens() []crypto.Token
func (*JoinNetwork) Validate ¶
func (j *JoinNetwork) Validate(v ActionValidator) bool
type KeyExchange ¶
type MutatingState ¶
type MutatingState struct {
// contains filtered or unexported fields
}
func (*MutatingState) HasHandle ¶
func (s *MutatingState) HasHandle(handle string) bool
func (*MutatingState) Mutations ¶
func (m *MutatingState) Mutations() *Mutations
func (*MutatingState) PowerOfAttorney ¶
func (s *MutatingState) PowerOfAttorney(token, attorney crypto.Token) bool
func (*MutatingState) SetNewGrantPower ¶
func (s *MutatingState) SetNewGrantPower(token, attorney crypto.Token) bool
func (*MutatingState) SetNewMember ¶
func (s *MutatingState) SetNewMember(token crypto.Token, handle string) bool
func (*MutatingState) SetNewRevokePower ¶
func (s *MutatingState) SetNewRevokePower(token, attorney crypto.Token) bool
func (*MutatingState) Validate ¶
func (v *MutatingState) Validate(data []byte) bool
type Mutations ¶
type Mutations struct { GrantPower map[crypto.Hash]struct{} RevokePower map[crypto.Hash]struct{} NewMembers map[crypto.Hash]struct{} NewCaption map[crypto.Hash]struct{} }
func NewMutations ¶
func NewMutations() *Mutations
type RevokePowerOfAttorney ¶
type RevokePowerOfAttorney struct { Epoch uint64 Author crypto.Token Attorney crypto.Token Signature crypto.Signature }
func ParseRevokePowerOfAttorney ¶
func ParseRevokePowerOfAttorney(data []byte) *RevokePowerOfAttorney
func (*RevokePowerOfAttorney) Kind ¶
func (r *RevokePowerOfAttorney) Kind() byte
func (*RevokePowerOfAttorney) Serialize ¶
func (r *RevokePowerOfAttorney) Serialize() []byte
func (*RevokePowerOfAttorney) Sign ¶
func (r *RevokePowerOfAttorney) Sign(pk crypto.PrivateKey)
func (*RevokePowerOfAttorney) Tokens ¶
func (r *RevokePowerOfAttorney) Tokens() []crypto.Token
func (*RevokePowerOfAttorney) Validate ¶
func (r *RevokePowerOfAttorney) Validate(v ActionValidator) bool
type State ¶
type State struct { Members *hashVault Captions *hashVault Attorneys *hashVault }
func NewGenesisState ¶
func StateFromBytes ¶
func (*State) ChecksumPoint ¶
ChecksumHash returns the hash of the checksum of the state.
func (*State) Clone ¶
func (s *State) Clone() chan social.Stateful[*Mutations, *MutatingState]
Clone creates a copy of the state by cloning the underlying papirus hashtable stores.
func (*State) CloneAsync ¶
CloneAsync starts a jobe to cloning the underlying hashtable stores. Returns a channel to a state object.
func (*State) Incorporate ¶
func (*State) Validator ¶
func (s *State) Validator(mutations ...*Mutations) *MutatingState
type UpdateInfo ¶
type UpdateInfo struct { Epoch uint64 Author crypto.Token Details string Signer crypto.Token Signature crypto.Signature }
func ParseUpdateInfo ¶
func ParseUpdateInfo(data []byte) *UpdateInfo
func (*UpdateInfo) Kind ¶
func (u *UpdateInfo) Kind() byte
func (*UpdateInfo) Serialize ¶
func (u *UpdateInfo) Serialize() []byte
func (*UpdateInfo) Sign ¶
func (u *UpdateInfo) Sign(pk crypto.PrivateKey)
func (*UpdateInfo) Tokens ¶
func (u *UpdateInfo) Tokens() []crypto.Token
func (*UpdateInfo) Validate ¶
func (u *UpdateInfo) Validate(v ActionValidator) bool
Click to show internal directories.
Click to hide internal directories.