Documentation ¶
Index ¶
- Constants
- Variables
- func NewFloodSub(ctx context.Context, le *logrus.Entry, handler pubsub.PubSubHandler, ...) (pubsub.PubSub, error)
- type Config
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (x *Config) GetPublishHashType() hash.HashType
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type FloodSub
- func (m *FloodSub) AddPeerStream(tpl pubsub.PeerLinkTuple, initiator bool, mstrm link.MountedStream)
- func (m *FloodSub) AddSubscription(ctx context.Context, privKey crypto.PrivKey, channelID string) (pubsub.Subscription, error)
- func (m *FloodSub) Close()
- func (m *FloodSub) Execute(ctx context.Context) error
- func (m *FloodSub) Publish(ctx context.Context, channelID string, privKey crypto.PrivKey, data []byte) error
- type Packet
- func (m *Packet) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Packet) CloneVT() *Packet
- func (this *Packet) EqualMessageVT(thatMsg any) bool
- func (this *Packet) EqualVT(that *Packet) bool
- func (x *Packet) GetPublish() []*peer.SignedMsg
- func (x *Packet) GetSubscriptions() []*SubscriptionOpts
- func (x *Packet) MarshalJSON() ([]byte, error)
- func (x *Packet) MarshalProtoJSON(s *json.MarshalState)
- func (x *Packet) MarshalProtoText() string
- func (m *Packet) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Packet) MarshalToVT(dAtA []byte) (int, error)
- func (m *Packet) MarshalVT() (dAtA []byte, err error)
- func (*Packet) ProtoMessage()
- func (x *Packet) Reset()
- func (m *Packet) SizeVT() (n int)
- func (x *Packet) String() string
- func (x *Packet) UnmarshalJSON(b []byte) error
- func (x *Packet) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Packet) UnmarshalVT(dAtA []byte) error
- type SubscriptionOpts
- func (m *SubscriptionOpts) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *SubscriptionOpts) CloneVT() *SubscriptionOpts
- func (this *SubscriptionOpts) EqualMessageVT(thatMsg any) bool
- func (this *SubscriptionOpts) EqualVT(that *SubscriptionOpts) bool
- func (x *SubscriptionOpts) GetChannelId() string
- func (x *SubscriptionOpts) GetSubscribe() bool
- func (x *SubscriptionOpts) MarshalJSON() ([]byte, error)
- func (x *SubscriptionOpts) MarshalProtoJSON(s *json.MarshalState)
- func (x *SubscriptionOpts) MarshalProtoText() string
- func (m *SubscriptionOpts) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *SubscriptionOpts) MarshalToVT(dAtA []byte) (int, error)
- func (m *SubscriptionOpts) MarshalVT() (dAtA []byte, err error)
- func (*SubscriptionOpts) ProtoMessage()
- func (x *SubscriptionOpts) Reset()
- func (m *SubscriptionOpts) SizeVT() (n int)
- func (x *SubscriptionOpts) String() string
- func (x *SubscriptionOpts) UnmarshalJSON(b []byte) error
- func (x *SubscriptionOpts) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *SubscriptionOpts) UnmarshalVT(dAtA []byte) error
Constants ¶
const (
FloodSubID = protocol.ID("bifrost/floodsub")
)
Variables ¶
var ( HeartbeatInitialDelay = 100 * time.Millisecond HeartbeatInterval = 1 * time.Second SubFanoutTTL = 60 * time.Second )
Functions ¶
Types ¶
type Config ¶
type Config struct { // PublishHashType is the hash type to use when signing published messages. // Defaults to sha256 PublishHashType hash.HashType `protobuf:"varint,1,opt,name=publish_hash_type,json=publishHashType,proto3" json:"publishHashType,omitempty"` // contains filtered or unexported fields }
Config configures the floodsub router.
func (*Config) CloneMessageVT ¶ added in v0.15.6
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶ added in v0.15.6
func (*Config) GetPublishHashType ¶
func (*Config) MarshalJSON ¶ added in v0.29.0
MarshalJSON marshals the Config to JSON.
func (*Config) MarshalProtoJSON ¶ added in v0.29.0
func (x *Config) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config message to JSON.
func (*Config) MarshalProtoText ¶ added in v0.29.2
func (*Config) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶ added in v0.29.0
UnmarshalJSON unmarshals the Config from JSON.
func (*Config) UnmarshalProtoJSON ¶ added in v0.29.0
func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config message from JSON.
func (*Config) UnmarshalVT ¶ added in v0.2.0
type FloodSub ¶
type FloodSub struct {
// contains filtered or unexported fields
}
FloodSub implements the FloodSub router.
TODO bind to a specific peer
func (*FloodSub) AddPeerStream ¶
func (m *FloodSub) AddPeerStream( tpl pubsub.PeerLinkTuple, initiator bool, mstrm link.MountedStream, )
AddPeerStream adds a negotiated peer stream. The pubsub should communicate over the stream.
func (*FloodSub) AddSubscription ¶
func (m *FloodSub) AddSubscription(ctx context.Context, privKey crypto.PrivKey, channelID string) (pubsub.Subscription, error)
AddSubscription adds a channel subscription, returning a subscription handle.
type Packet ¶
type Packet struct { // Subscriptions contains any new subscription changes. Subscriptions []*SubscriptionOpts `protobuf:"bytes,1,rep,name=subscriptions,proto3" json:"subscriptions,omitempty"` // Publish contains messages we are publishing. Publish []*peer.SignedMsg `protobuf:"bytes,2,rep,name=publish,proto3" json:"publish,omitempty"` // contains filtered or unexported fields }
Packet is the floodsub packet.
func (*Packet) CloneMessageVT ¶ added in v0.15.6
func (m *Packet) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Packet) EqualMessageVT ¶ added in v0.15.6
func (*Packet) GetPublish ¶
func (*Packet) GetSubscriptions ¶
func (x *Packet) GetSubscriptions() []*SubscriptionOpts
func (*Packet) MarshalJSON ¶ added in v0.29.0
MarshalJSON marshals the Packet to JSON.
func (*Packet) MarshalProtoJSON ¶ added in v0.29.0
func (x *Packet) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Packet message to JSON.
func (*Packet) MarshalProtoText ¶ added in v0.29.2
func (*Packet) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Packet) ProtoMessage ¶
func (*Packet) ProtoMessage()
func (*Packet) UnmarshalJSON ¶ added in v0.29.0
UnmarshalJSON unmarshals the Packet from JSON.
func (*Packet) UnmarshalProtoJSON ¶ added in v0.29.0
func (x *Packet) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Packet message from JSON.
func (*Packet) UnmarshalVT ¶ added in v0.2.0
type SubscriptionOpts ¶
type SubscriptionOpts struct { // Subscribe indicates if we are subscribing to this channel ID. Subscribe bool `protobuf:"varint,1,opt,name=subscribe,proto3" json:"subscribe,omitempty"` // ChannelId is the channel to subscribe to. ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channelId,omitempty"` // contains filtered or unexported fields }
SubscriptionOpts are subscription options.
func (*SubscriptionOpts) CloneMessageVT ¶ added in v0.15.6
func (m *SubscriptionOpts) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*SubscriptionOpts) CloneVT ¶ added in v0.8.3
func (m *SubscriptionOpts) CloneVT() *SubscriptionOpts
func (*SubscriptionOpts) EqualMessageVT ¶ added in v0.15.6
func (this *SubscriptionOpts) EqualMessageVT(thatMsg any) bool
func (*SubscriptionOpts) EqualVT ¶ added in v0.3.0
func (this *SubscriptionOpts) EqualVT(that *SubscriptionOpts) bool
func (*SubscriptionOpts) GetChannelId ¶
func (x *SubscriptionOpts) GetChannelId() string
func (*SubscriptionOpts) GetSubscribe ¶
func (x *SubscriptionOpts) GetSubscribe() bool
func (*SubscriptionOpts) MarshalJSON ¶ added in v0.29.0
func (x *SubscriptionOpts) MarshalJSON() ([]byte, error)
MarshalJSON marshals the SubscriptionOpts to JSON.
func (*SubscriptionOpts) MarshalProtoJSON ¶ added in v0.29.0
func (x *SubscriptionOpts) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the SubscriptionOpts message to JSON.
func (*SubscriptionOpts) MarshalProtoText ¶ added in v0.29.2
func (x *SubscriptionOpts) MarshalProtoText() string
func (*SubscriptionOpts) MarshalToSizedBufferVT ¶ added in v0.2.0
func (m *SubscriptionOpts) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*SubscriptionOpts) MarshalToVT ¶ added in v0.2.0
func (m *SubscriptionOpts) MarshalToVT(dAtA []byte) (int, error)
func (*SubscriptionOpts) MarshalVT ¶ added in v0.2.0
func (m *SubscriptionOpts) MarshalVT() (dAtA []byte, err error)
func (*SubscriptionOpts) ProtoMessage ¶
func (*SubscriptionOpts) ProtoMessage()
func (*SubscriptionOpts) Reset ¶
func (x *SubscriptionOpts) Reset()
func (*SubscriptionOpts) SizeVT ¶ added in v0.2.0
func (m *SubscriptionOpts) SizeVT() (n int)
func (*SubscriptionOpts) String ¶
func (x *SubscriptionOpts) String() string
func (*SubscriptionOpts) UnmarshalJSON ¶ added in v0.29.0
func (x *SubscriptionOpts) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the SubscriptionOpts from JSON.
func (*SubscriptionOpts) UnmarshalProtoJSON ¶ added in v0.29.0
func (x *SubscriptionOpts) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the SubscriptionOpts message from JSON.
func (*SubscriptionOpts) UnmarshalVT ¶ added in v0.2.0
func (m *SubscriptionOpts) UnmarshalVT(dAtA []byte) error