Documentation ¶
Index ¶
- Constants
- Variables
- func NewFloodSub(ctx context.Context, le *logrus.Entry, handler pubsub.PubSubHandler, ...) (pubsub.PubSub, error)
- type Config
- func (m *Config) CloneGenericVT() proto.Message
- func (m *Config) CloneVT() *Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (this *Config) EqualVT(that *Config) bool
- func (x *Config) GetPublishHashType() hash.HashType
- 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) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- 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) CloneGenericVT() proto.Message
- func (m *Packet) CloneVT() *Packet
- func (*Packet) Descriptor() ([]byte, []int)deprecated
- func (this *Packet) EqualVT(that *Packet) bool
- func (x *Packet) GetPublish() []*peer.SignedMsg
- func (x *Packet) GetSubscriptions() []*SubscriptionOpts
- 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) ProtoReflect() protoreflect.Message
- func (x *Packet) Reset()
- func (m *Packet) SizeVT() (n int)
- func (x *Packet) String() string
- func (m *Packet) UnmarshalVT(dAtA []byte) error
- type SubscriptionOpts
- func (m *SubscriptionOpts) CloneGenericVT() proto.Message
- func (m *SubscriptionOpts) CloneVT() *SubscriptionOpts
- func (*SubscriptionOpts) Descriptor() ([]byte, []int)deprecated
- func (this *SubscriptionOpts) EqualVT(that *SubscriptionOpts) bool
- func (x *SubscriptionOpts) GetChannelId() string
- func (x *SubscriptionOpts) GetSubscribe() bool
- 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) ProtoReflect() protoreflect.Message
- func (x *SubscriptionOpts) Reset()
- func (m *SubscriptionOpts) SizeVT() (n int)
- func (x *SubscriptionOpts) String() string
- func (m *SubscriptionOpts) UnmarshalVT(dAtA []byte) error
Constants ¶
View Source
const (
FloodSubID = protocol.ID("bifrost/floodsub/1")
)
Variables ¶
View Source
var ( HeartbeatInitialDelay = 100 * time.Millisecond HeartbeatInterval = 1 * time.Second SubFanoutTTL = 60 * time.Second )
View Source
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
View Source
var File_github_com_aperturerobotics_bifrost_pubsub_floodsub_floodsub_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Config ¶
type Config struct { // PublishHashType is the hash type to use when signing published messages. // Defaults to sha256 PublishHashType hash.HashType `` /* 128-byte string literal not displayed */ // contains filtered or unexported fields }
Config configures the floodsub router.
func (*Config) CloneGenericVT ¶ added in v0.8.3
func (*Config) Descriptor
deprecated
func (*Config) GetPublishHashType ¶
func (*Config) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶ added in v0.2.0
func (x *Config) ProtoReflect() protoreflect.Message
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) CloneGenericVT ¶ added in v0.8.3
func (*Packet) Descriptor
deprecated
func (*Packet) GetPublish ¶
func (*Packet) GetSubscriptions ¶
func (x *Packet) GetSubscriptions() []*SubscriptionOpts
func (*Packet) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Packet) ProtoMessage ¶
func (*Packet) ProtoMessage()
func (*Packet) ProtoReflect ¶ added in v0.2.0
func (x *Packet) ProtoReflect() protoreflect.Message
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:"channel_id,omitempty"` // contains filtered or unexported fields }
SubscriptionOpts are subscription options.
func (*SubscriptionOpts) CloneGenericVT ¶ added in v0.8.3
func (m *SubscriptionOpts) CloneGenericVT() proto.Message
func (*SubscriptionOpts) CloneVT ¶ added in v0.8.3
func (m *SubscriptionOpts) CloneVT() *SubscriptionOpts
func (*SubscriptionOpts) Descriptor
deprecated
func (*SubscriptionOpts) Descriptor() ([]byte, []int)
Deprecated: Use SubscriptionOpts.ProtoReflect.Descriptor instead.
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) 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) ProtoReflect ¶ added in v0.2.0
func (x *SubscriptionOpts) ProtoReflect() protoreflect.Message
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) UnmarshalVT ¶ added in v0.2.0
func (m *SubscriptionOpts) UnmarshalVT(dAtA []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.