Documentation ¶
Overview ¶
Package operation is the collection of Operations.
Index ¶
- Constants
- Variables
- func IsValidOperation(op Operation, networkID []byte) error
- func IsValidOperationFact(fact OperationFact, networkID []byte) error
- func LastSignedAt(fs []base.FactSign) time.Time
- type BaseOperation
- func (bo BaseOperation) AddFactSigns(fs ...base.FactSign) (base.FactSignUpdater, error)
- func (bo BaseOperation) BSONM() bson.M
- func (bo BaseOperation) Fact() base.Fact
- func (bo BaseOperation) GenerateHash() valuehash.Hash
- func (bo BaseOperation) Hash() valuehash.Hash
- func (bo BaseOperation) IsValid(networkID []byte) error
- func (bo BaseOperation) JSONM() map[string]interface{}
- func (bo BaseOperation) LastSignedAt() time.Time
- func (bo BaseOperation) MarshalBSON() ([]byte, error)
- func (bo BaseOperation) MarshalJSON() ([]byte, error)
- func (bo BaseOperation) SetHash(h valuehash.Hash) BaseOperation
- func (bo BaseOperation) Signs() []base.FactSign
- func (bo BaseOperation) Token() []byte
- func (bo *BaseOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (bo *BaseOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type BaseOperationBSONUnpacker
- type BaseReasonError
- func (e BaseReasonError) Data() map[string]interface{}
- func (e BaseReasonError) Error() string
- func (e BaseReasonError) Errorf(s string, a ...interface{}) ReasonError
- func (e BaseReasonError) Format(s fmt.State, v rune)
- func (BaseReasonError) Hint() hint.Hint
- func (e BaseReasonError) MarshalBSON() ([]byte, error)
- func (e BaseReasonError) MarshalJSON() ([]byte, error)
- func (e BaseReasonError) Msg() string
- func (e BaseReasonError) SetData(data map[string]interface{}) BaseReasonError
- func (e *BaseReasonError) UnmarshalBSON(b []byte) error
- func (e *BaseReasonError) UnmarshalJSON(b []byte) error
- type BaseReasonErrorBSONUnpacker
- type BaseReasonErrorJSONPacker
- type BaseReasonErrorJSONUnpacker
- type BaseSeal
- func (sl BaseSeal) BodyBytes() []byte
- func (sl BaseSeal) IsValid(networkID []byte) error
- func (sl BaseSeal) MarshalBSON() ([]byte, error)
- func (sl BaseSeal) MarshalJSON() ([]byte, error)
- func (sl BaseSeal) Operations() []Operation
- func (sl BaseSeal) SetOperations(ops []Operation) SealUpdater
- func (sl *BaseSeal) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (sl *BaseSeal) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type BaseSealBSONUnpack
- type BaseSealJSONPack
- type BaseSealJSONUnpack
- type FixedTreeNode
- func (no FixedTreeNode) Equal(n tree.FixedTreeNode) bool
- func (no FixedTreeNode) InState() bool
- func (no FixedTreeNode) MarshalBSON() ([]byte, error)
- func (no FixedTreeNode) MarshalJSON() ([]byte, error)
- func (no FixedTreeNode) Reason() ReasonError
- func (no FixedTreeNode) SetHash(h []byte) tree.FixedTreeNode
- func (no *FixedTreeNode) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
- func (no *FixedTreeNode) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
- type FixedTreeNodeBSONUnpacker
- type FixedTreeNodeJSONPacker
- type FixedTreeNodeJSONUnpacker
- type Operation
- type OperationFact
- type ReasonError
- type Seal
- type SealUpdater
Constants ¶
View Source
const MaxTokenSize = 100
Variables ¶
View Source
var ( SealType = hint.Type("seal") SealHint = hint.NewHint(SealType, "v0.0.1") SealHinter = BaseSeal{BaseSeal: seal.NewBaseSealWithHint(SealHint)} )
View Source
var ( FixedTreeNodeType = hint.Type("operation-fixedtree-node") FixedTreeNodeHint = hint.NewHint(FixedTreeNodeType, "v0.0.1") FixedTreeNodeHinter = FixedTreeNode{ BaseFixedTreeNode: tree.BaseFixedTreeNode{BaseHinter: hint.NewBaseHinter(FixedTreeNodeHint)}, } BaseReasonErrorType = hint.Type("base-operation-reason") BaseReasonErrorHint = hint.NewHint(BaseReasonErrorType, "v0.0.1") )
Functions ¶
func IsValidOperation ¶
func IsValidOperationFact ¶
func IsValidOperationFact(fact OperationFact, networkID []byte) error
Types ¶
type BaseOperation ¶
type BaseOperation struct { hint.BaseHinter // contains filtered or unexported fields }
func EmptyBaseOperation ¶
func EmptyBaseOperation(ht hint.Hint) BaseOperation
func NewBaseOperation ¶
func NewBaseOperation(ht hint.Hint, fact OperationFact, h valuehash.Hash, fs []base.FactSign) BaseOperation
func NewBaseOperationFromFact ¶
func NewBaseOperationFromFact(ht hint.Hint, fact OperationFact, fs []base.FactSign) (BaseOperation, error)
func (BaseOperation) AddFactSigns ¶
func (bo BaseOperation) AddFactSigns(fs ...base.FactSign) (base.FactSignUpdater, error)
func (BaseOperation) BSONM ¶
func (bo BaseOperation) BSONM() bson.M
func (BaseOperation) Fact ¶
func (bo BaseOperation) Fact() base.Fact
func (BaseOperation) GenerateHash ¶
func (bo BaseOperation) GenerateHash() valuehash.Hash
func (BaseOperation) Hash ¶
func (bo BaseOperation) Hash() valuehash.Hash
func (BaseOperation) IsValid ¶
func (bo BaseOperation) IsValid(networkID []byte) error
func (BaseOperation) JSONM ¶
func (bo BaseOperation) JSONM() map[string]interface{}
func (BaseOperation) LastSignedAt ¶
func (bo BaseOperation) LastSignedAt() time.Time
func (BaseOperation) MarshalBSON ¶
func (bo BaseOperation) MarshalBSON() ([]byte, error)
func (BaseOperation) MarshalJSON ¶
func (bo BaseOperation) MarshalJSON() ([]byte, error)
func (BaseOperation) SetHash ¶
func (bo BaseOperation) SetHash(h valuehash.Hash) BaseOperation
func (BaseOperation) Signs ¶
func (bo BaseOperation) Signs() []base.FactSign
func (BaseOperation) Token ¶
func (bo BaseOperation) Token() []byte
func (*BaseOperation) UnpackBSON ¶
func (bo *BaseOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*BaseOperation) UnpackJSON ¶
func (bo *BaseOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type BaseReasonError ¶
func NewBaseReasonError ¶
func NewBaseReasonError(s string, a ...interface{}) BaseReasonError
func (BaseReasonError) Data ¶
func (e BaseReasonError) Data() map[string]interface{}
func (BaseReasonError) Error ¶
func (e BaseReasonError) Error() string
func (BaseReasonError) Errorf ¶
func (e BaseReasonError) Errorf(s string, a ...interface{}) ReasonError
func (BaseReasonError) Hint ¶
func (BaseReasonError) Hint() hint.Hint
func (BaseReasonError) MarshalBSON ¶
func (e BaseReasonError) MarshalBSON() ([]byte, error)
func (BaseReasonError) MarshalJSON ¶
func (e BaseReasonError) MarshalJSON() ([]byte, error)
func (BaseReasonError) Msg ¶
func (e BaseReasonError) Msg() string
func (BaseReasonError) SetData ¶
func (e BaseReasonError) SetData(data map[string]interface{}) BaseReasonError
func (*BaseReasonError) UnmarshalBSON ¶
func (e *BaseReasonError) UnmarshalBSON(b []byte) error
func (*BaseReasonError) UnmarshalJSON ¶
func (e *BaseReasonError) UnmarshalJSON(b []byte) error
type BaseReasonErrorJSONPacker ¶
type BaseReasonErrorJSONPacker struct { jsonenc.HintedHead MS string `json:"msg"` DT map[string]interface{} `json:"data"` }
type BaseSeal ¶
func NewBaseSeal ¶
func (BaseSeal) MarshalBSON ¶
func (BaseSeal) MarshalJSON ¶
func (BaseSeal) Operations ¶
func (BaseSeal) SetOperations ¶
func (sl BaseSeal) SetOperations(ops []Operation) SealUpdater
type BaseSealBSONUnpack ¶
type BaseSealJSONPack ¶
type BaseSealJSONPack struct { *seal.BaseSealJSONPack OPS []Operation `json:"operations"` }
type BaseSealJSONUnpack ¶
type BaseSealJSONUnpack struct {
OPS json.RawMessage `json:"operations"`
}
type FixedTreeNode ¶
type FixedTreeNode struct { tree.BaseFixedTreeNode // contains filtered or unexported fields }
func NewFixedTreeNode ¶
func NewFixedTreeNode(index uint64, key []byte, inState bool, reason error) FixedTreeNode
func NewFixedTreeNodeWithHash ¶
func NewFixedTreeNodeWithHash(index uint64, key, hash []byte, inState bool, reason error) FixedTreeNode
func (FixedTreeNode) Equal ¶
func (no FixedTreeNode) Equal(n tree.FixedTreeNode) bool
func (FixedTreeNode) InState ¶
func (no FixedTreeNode) InState() bool
func (FixedTreeNode) MarshalBSON ¶
func (no FixedTreeNode) MarshalBSON() ([]byte, error)
func (FixedTreeNode) MarshalJSON ¶
func (no FixedTreeNode) MarshalJSON() ([]byte, error)
func (FixedTreeNode) Reason ¶
func (no FixedTreeNode) Reason() ReasonError
func (FixedTreeNode) SetHash ¶
func (no FixedTreeNode) SetHash(h []byte) tree.FixedTreeNode
func (*FixedTreeNode) UnpackBSON ¶
func (no *FixedTreeNode) UnpackBSON(b []byte, enc *bsonenc.Encoder) error
func (*FixedTreeNode) UnpackJSON ¶
func (no *FixedTreeNode) UnpackJSON(b []byte, enc *jsonenc.Encoder) error
type FixedTreeNodeJSONPacker ¶
type FixedTreeNodeJSONPacker struct { jsonenc.HintedHead IN uint64 `json:"index"` KY string `json:"key"` HS string `json:"hash"` IS bool `json:"in_state"` RS ReasonError `json:"reason"` }
type FixedTreeNodeJSONUnpacker ¶
type FixedTreeNodeJSONUnpacker struct { IS bool `json:"in_state"` RS json.RawMessage `json:"reason"` }
type OperationFact ¶
type ReasonError ¶
type ReasonError interface { error hint.Hinter Msg() string Data() map[string]interface{} Errorf(string, ...interface{}) ReasonError }
func NewBaseReasonErrorFromError ¶
func NewBaseReasonErrorFromError(err error) ReasonError
type SealUpdater ¶
type SealUpdater interface {
SetOperations([]Operation) SealUpdater
}
Click to show internal directories.
Click to hide internal directories.