Documentation
¶
Index ¶
- func NewExampleBlock() block.Block
- func NewMockStore(hashType hash.HashType) block.StoreOps
- func NewRootBlock() block.Block
- func NewSubBlockBlock() block.Block
- type Example
- func (m *Example) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Example) CloneVT() *Example
- func (e *Example) DecodedBlockCacheTypeKey() string
- func (this *Example) EqualMessageVT(thatMsg any) bool
- func (this *Example) EqualVT(that *Example) bool
- func (x *Example) GetMsg() string
- func (e *Example) MarshalBlock() ([]byte, error)
- func (x *Example) MarshalJSON() ([]byte, error)
- func (x *Example) MarshalProtoJSON(s *json.MarshalState)
- func (x *Example) MarshalProtoText() string
- func (m *Example) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Example) MarshalToVT(dAtA []byte) (int, error)
- func (m *Example) MarshalVT() (dAtA []byte, err error)
- func (*Example) ProtoMessage()
- func (x *Example) Reset()
- func (m *Example) SizeVT() (n int)
- func (x *Example) String() string
- func (e *Example) UnmarshalBlock(data []byte) error
- func (x *Example) UnmarshalJSON(b []byte) error
- func (x *Example) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Example) UnmarshalVT(dAtA []byte) error
- type Root
- func (r *Root) ApplySubBlock(id uint32, next block.SubBlock) error
- func (r *Root) BlockAliasIdentity() *block.AliasIdentityToken
- func (m *Root) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Root) CloneVT() *Root
- func (this *Root) EqualMessageVT(thatMsg any) bool
- func (this *Root) EqualVT(that *Root) bool
- func (x *Root) GetExampleSubBlock() *SubBlock
- func (r *Root) GetSubBlockCtor(id uint32) block.SubBlockCtor
- func (r *Root) GetSubBlocks() map[uint32]block.SubBlock
- func (r *Root) IsNil() bool
- func (r *Root) MarshalBlock() ([]byte, error)
- func (x *Root) MarshalJSON() ([]byte, error)
- func (x *Root) MarshalProtoJSON(s *json.MarshalState)
- func (x *Root) MarshalProtoText() string
- func (m *Root) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Root) MarshalToVT(dAtA []byte) (int, error)
- func (m *Root) MarshalVT() (dAtA []byte, err error)
- func (*Root) ProtoMessage()
- func (x *Root) Reset()
- func (m *Root) SizeVT() (n int)
- func (x *Root) String() string
- func (r *Root) UnmarshalBlock(data []byte) error
- func (x *Root) UnmarshalJSON(b []byte) error
- func (x *Root) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Root) UnmarshalVT(dAtA []byte) error
- type SubBlock
- func (r *SubBlock) ApplyBlockRef(id uint32, ptr *block.BlockRef) error
- func (r *SubBlock) BlockAliasIdentity() *block.AliasIdentityToken
- func (m *SubBlock) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *SubBlock) CloneVT() *SubBlock
- func (this *SubBlock) EqualMessageVT(thatMsg any) bool
- func (this *SubBlock) EqualVT(that *SubBlock) bool
- func (r *SubBlock) GetBlockRefCtor(id uint32) block.Ctor
- func (r *SubBlock) GetBlockRefs() (map[uint32]*block.BlockRef, error)
- func (x *SubBlock) GetExamplePtr() *block.BlockRef
- func (r *SubBlock) IsNil() bool
- func (r *SubBlock) MarshalBlock() ([]byte, error)
- func (x *SubBlock) MarshalJSON() ([]byte, error)
- func (x *SubBlock) MarshalProtoJSON(s *json.MarshalState)
- func (x *SubBlock) MarshalProtoText() string
- func (m *SubBlock) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *SubBlock) MarshalToVT(dAtA []byte) (int, error)
- func (m *SubBlock) MarshalVT() (dAtA []byte, err error)
- func (*SubBlock) ProtoMessage()
- func (x *SubBlock) Reset()
- func (m *SubBlock) SizeVT() (n int)
- func (x *SubBlock) String() string
- func (r *SubBlock) UnmarshalBlock(data []byte) error
- func (x *SubBlock) UnmarshalJSON(b []byte) error
- func (x *SubBlock) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *SubBlock) UnmarshalVT(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExampleBlock ¶
NewExampleBlock builds a new example block.
func NewMockStore ¶
NewMockStore constructs a new mock bucket for testing.
hashType is the hash type to use, 0 for default.
func NewSubBlockBlock ¶
NewSubBlockBlock constructs a SubBlock as a Block.
Types ¶
type Example ¶
type Example struct {
// Msg is a message.
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
// contains filtered or unexported fields
}
Example is the value pointed to by ExamplePtr.
func NewExample ¶
NewExample builds a new example block with a message.
func UnmarshalExample ¶
UnmarshalExample unmarshals the example block. Returns nil, nil if empty
func (*Example) CloneMessageVT ¶
func (m *Example) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Example) DecodedBlockCacheTypeKey ¶ added in v0.51.7
DecodedBlockCacheTypeKey returns the decoded-block cache type key.
func (*Example) EqualMessageVT ¶
func (*Example) MarshalBlock ¶
MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.
func (*Example) MarshalJSON ¶
MarshalJSON marshals the Example to JSON.
func (*Example) MarshalProtoJSON ¶
func (x *Example) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Example message to JSON.
func (*Example) MarshalProtoText ¶
func (*Example) MarshalToSizedBufferVT ¶
func (*Example) ProtoMessage ¶
func (*Example) ProtoMessage()
func (*Example) UnmarshalBlock ¶
UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.
func (*Example) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Example from JSON.
func (*Example) UnmarshalProtoJSON ¶
func (x *Example) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Example message from JSON.
func (*Example) UnmarshalVT ¶
type Root ¶
type Root struct {
// ExampleSubBlock is a sub-block.
ExampleSubBlock *SubBlock `protobuf:"bytes,1,opt,name=example_sub_block,json=exampleSubBlock,proto3" json:"exampleSubBlock,omitempty"`
// contains filtered or unexported fields
}
Root is the root of the mock structure.
func (*Root) ApplySubBlock ¶
ApplySubBlock applies a sub-block change with a field id.
func (*Root) BlockAliasIdentity ¶ added in v0.52.0
func (r *Root) BlockAliasIdentity() *block.AliasIdentityToken
BlockAliasIdentity returns the in-memory alias token for Root.
func (*Root) CloneMessageVT ¶
func (m *Root) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Root) EqualMessageVT ¶
func (*Root) GetExampleSubBlock ¶
func (*Root) GetSubBlockCtor ¶
func (r *Root) GetSubBlockCtor(id uint32) block.SubBlockCtor
GetSubBlockCtor returns a function which creates or returns the existing sub-block at reference id. Can return nil to indicate invalid reference id.
func (*Root) GetSubBlocks ¶
GetSubBlocks returns all constructed sub-blocks by ID. May return nil, and values may also be nil.
func (*Root) MarshalBlock ¶
MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.
func (*Root) MarshalJSON ¶
MarshalJSON marshals the Root to JSON.
func (*Root) MarshalProtoJSON ¶
func (x *Root) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Root message to JSON.
func (*Root) MarshalProtoText ¶
func (*Root) MarshalToSizedBufferVT ¶
func (*Root) ProtoMessage ¶
func (*Root) ProtoMessage()
func (*Root) UnmarshalBlock ¶
UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.
func (*Root) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Root from JSON.
func (*Root) UnmarshalProtoJSON ¶
func (x *Root) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Root message from JSON.
func (*Root) UnmarshalVT ¶
type SubBlock ¶
type SubBlock struct {
// ExamplePtr is an example reference.
ExamplePtr *block.BlockRef `protobuf:"bytes,1,opt,name=example_ptr,json=examplePtr,proto3" json:"examplePtr,omitempty"`
// contains filtered or unexported fields
}
SubBlock is a example sub-block of Root.
func (*SubBlock) ApplyBlockRef ¶
ApplyBlockRef applies a ref change with a field id.
func (*SubBlock) BlockAliasIdentity ¶ added in v0.52.0
func (r *SubBlock) BlockAliasIdentity() *block.AliasIdentityToken
BlockAliasIdentity returns the in-memory alias token for SubBlock.
func (*SubBlock) CloneMessageVT ¶
func (m *SubBlock) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*SubBlock) EqualMessageVT ¶
func (*SubBlock) GetBlockRefCtor ¶
GetBlockRefCtor returns the constructor for the block at the ref id. Return nil to indicate invalid ref ID.
func (*SubBlock) GetBlockRefs ¶
GetBlockRefs returns all filled block references.
func (*SubBlock) GetExamplePtr ¶
func (*SubBlock) MarshalBlock ¶
MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.
func (*SubBlock) MarshalJSON ¶
MarshalJSON marshals the SubBlock to JSON.
func (*SubBlock) MarshalProtoJSON ¶
func (x *SubBlock) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the SubBlock message to JSON.
func (*SubBlock) MarshalProtoText ¶
func (*SubBlock) MarshalToSizedBufferVT ¶
func (*SubBlock) ProtoMessage ¶
func (*SubBlock) ProtoMessage()
func (*SubBlock) UnmarshalBlock ¶
UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.
func (*SubBlock) UnmarshalJSON ¶
UnmarshalJSON unmarshals the SubBlock from JSON.
func (*SubBlock) UnmarshalProtoJSON ¶
func (x *SubBlock) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the SubBlock message from JSON.