Documentation ¶
Index ¶
- func DecodePayload[T interface{}](payloadBytes []byte) (T, error)
- func DecodePocket(pocketBytes []byte) (transporter.Pocket[[]byte], error)
- type Block
- type BlockAction
- type BlockNode
- func (bn *BlockNode) AddBlock(blocks ...IBlock) error
- func (bn *BlockNode) Blocks() map[types.BlockName][]types.ActionName
- func (bn *BlockNode) Database() *db.Database
- func (bn *BlockNode) GetName() string
- func (bn *BlockNode) NodeID() types.NodeID
- func (bn *BlockNode) ProcessPocketDiscovery(pocket transporter.Pocket[transporter.PayloadDiscovery])
- func (bn *BlockNode) Receive(payload []byte)
- func (bn *BlockNode) ReceiveResponse(payload []byte)
- func (bn *BlockNode) Send(payload *transporter.PayloadMessage, targetAction *types.TargetAction) (*transporter.PayloadMessage, error)
- func (bn *BlockNode) Start() error
- func (bn *BlockNode) Stop() error
- func (bn *BlockNode) Version() uint
- func (bn *BlockNode) VersionName() types.NodeVersionName
- type BlockNodeOptions
- type IBlock
- type SentHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePayload ¶
func DecodePocket ¶
func DecodePocket(pocketBytes []byte) (transporter.Pocket[[]byte], error)
Types ¶
type Block ¶
func (*Block) Actions ¶
func (b *Block) Actions() map[types.ActionName]BlockAction
func (*Block) ActionsNames ¶
func (b *Block) ActionsNames() []types.ActionName
func (*Block) AddAction ¶
func (b *Block) AddAction(name types.ActionName, action BlockAction)
type BlockAction ¶
type BlockAction func(payload transporter.PayloadMessage) (*transporter.PayloadMessage, error)
type BlockNode ¶
type BlockNode struct {
// contains filtered or unexported fields
}
func GetBlockNode ¶ added in v0.1.5
func GetBlockNode() *BlockNode
func NewBlockNode ¶
func NewBlockNode(options *BlockNodeOptions) *BlockNode
NewBlockNode creates new BlockNode struct
func (*BlockNode) ProcessPocketDiscovery ¶
func (bn *BlockNode) ProcessPocketDiscovery(pocket transporter.Pocket[transporter.PayloadDiscovery])
func (*BlockNode) ReceiveResponse ¶
func (*BlockNode) Send ¶
func (bn *BlockNode) Send(payload *transporter.PayloadMessage, targetAction *types.TargetAction) (*transporter.PayloadMessage, error)
func (*BlockNode) VersionName ¶
func (bn *BlockNode) VersionName() types.NodeVersionName
type BlockNodeOptions ¶
type IBlock ¶
type IBlock interface { GetName() types.BlockName Actions() map[types.ActionName]BlockAction ActionsNames() []types.ActionName AddAction(name types.ActionName, action BlockAction) }
Click to show internal directories.
Click to hide internal directories.