Documentation
¶
Index ¶
Constants ¶
View Source
const (
RandomDelivery types.DeliveryMethod = "random"
)
Variables ¶
View Source
var (
ErrInvalidDeliveryMethod = errors.New("invalid delivery method")
)
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel string
const ( ChanPrefix = "bn_" ChanDiscovery Channel = ChanPrefix + "discovery" ChanMessage Channel = ChanPrefix + "msg" ChanMessageResponse Channel = ChanPrefix + "msg_res" ChanStorage Channel = ChanPrefix + "storage" )
type PayloadDiscovery ¶
type PayloadDiscovery struct { Blocks map[types.BlockName][]types.ActionName `json:"blocks"` Event Event `json:"event"` }
type PayloadMessage ¶
type PayloadMessage struct {
Data any `json:"data"`
}
func NewPayloadMessage ¶
func NewPayloadMessage(data any) PayloadMessage
func (*PayloadMessage) JSON ¶
func (pa *PayloadMessage) JSON() ([]byte, error)
type Pocket ¶
type Pocket[P []byte | any] struct { Channel Channel `json:"channel"` VersionName types.NodeVersionName `json:"version_name"` FromID types.NodeID `json:"from_id"` TargetID *types.NodeID `json:"target_id"` TargetAction *types.TargetAction `json:"target_action"` Payload P `json:"payload"` Hash string `json:"hash"` ResponseHash string `json:"hash_res"` }
func NewPocket ¶
func NewPocket[P PayloadDiscovery | PayloadMessage](channel Channel, versionName types.NodeVersionName, fromID types.NodeID, targetID *types.NodeID, targetAction *types.TargetAction, payload P) Pocket[[]byte]
NewPocket creates new network pocket
type PubDaemon ¶
type PubDaemon struct {
// contains filtered or unexported fields
}
func NewPubDaemon ¶
type Redis ¶
type Redis struct { Transporter // contains filtered or unexported fields }
func (*Redis) Disconnect ¶
type SubDaemon ¶
type SubDaemon struct {
// contains filtered or unexported fields
}
func NewSubDaemon ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.