Documentation ¶
Overview ¶
Package seal is the basic form of message.
Index ¶
- func IsValidSeal(seal Seal, networkID []byte) error
- func LogEventSeal(sl Seal, key string, e *zerolog.Event, isTrace bool) *zerolog.Event
- type BaseSeal
- func (sl BaseSeal) BSONPacker() map[string]interface{}
- func (sl BaseSeal) BodyBytes() []byte
- func (sl BaseSeal) BodyHash() valuehash.Hash
- func (sl BaseSeal) GenerateBodyHash() (valuehash.Hash, error)
- func (sl BaseSeal) GenerateHash() valuehash.Hash
- func (sl BaseSeal) Hash() valuehash.Hash
- func (sl BaseSeal) IsValid(networkID []byte) error
- func (sl BaseSeal) JSONPacker() *BaseSealJSONPack
- func (sl *BaseSeal) Sign(pk key.Privatekey, b []byte) error
- func (sl *BaseSeal) SignWithTime(pk key.Privatekey, networkID []byte, t time.Time) error
- func (sl BaseSeal) Signature() key.Signature
- func (sl BaseSeal) SignedAt() time.Time
- func (sl BaseSeal) Signer() key.Publickey
- 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 DummySeal
- func (ds DummySeal) BodyHash() valuehash.Hash
- func (ds DummySeal) GenerateBodyHash() (valuehash.Hash, error)
- func (ds DummySeal) GenerateHash() valuehash.Hash
- func (ds DummySeal) Hash() valuehash.Hash
- func (ds DummySeal) Hint() hint.Hint
- func (ds DummySeal) IsValid([]byte) error
- func (ds DummySeal) MarshalBSON() ([]byte, error)
- func (ds DummySeal) MarshalJSON() ([]byte, error)
- func (ds DummySeal) Signature() key.Signature
- func (ds DummySeal) SignedAt() time.Time
- func (ds DummySeal) Signer() key.Publickey
- func (ds *DummySeal) UnmarshalBSON(b []byte) error
- func (ds *DummySeal) UnmarshalJSON(b []byte) error
- type DummySealBSONUnpacker
- type DummySealJSONPacker
- type DummySealJSONUnpacker
- type Seal
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidSeal ¶
Types ¶
type BaseSeal ¶
type BaseSeal struct { hint.BaseHinter GenerateBodyHashFunc func() (valuehash.Hash, error) // contains filtered or unexported fields }
func NewBaseSealWithHint ¶
func (BaseSeal) BSONPacker ¶
func (BaseSeal) GenerateHash ¶
func (BaseSeal) JSONPacker ¶
func (sl BaseSeal) JSONPacker() *BaseSealJSONPack
func (*BaseSeal) SignWithTime ¶
type BaseSealBSONUnpack ¶
type BaseSealJSONPack ¶
type BaseSealJSONUnpack ¶
type DummySeal ¶
type DummySeal struct { PK key.Publickey H valuehash.Hash BH valuehash.Hash S string CreatedAt time.Time }
func NewDummySeal ¶
func (DummySeal) GenerateHash ¶
func (DummySeal) MarshalBSON ¶
func (DummySeal) MarshalJSON ¶
func (*DummySeal) UnmarshalBSON ¶
func (*DummySeal) UnmarshalJSON ¶
type DummySealBSONUnpacker ¶
type DummySealJSONPacker ¶
type DummySealJSONUnpacker ¶
type Seal ¶
type Seal interface { isvalid.IsValider hint.Hinter valuehash.HashGenerator // geneate new hash of seal Hash() valuehash.Hash // hash of seal BodyHash() valuehash.Hash // hash of seal body GenerateBodyHash() (valuehash.Hash, error) // geneate new hash of seal body Signer() key.Publickey // signer's PublicKey Signature() key.Signature // Signature, signed by key SignedAt() time.Time // signed(or created) time }
Seal is the container of SealBody.
Click to show internal directories.
Click to hide internal directories.