Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
Message gets converted to/from JSON and sent in the body of pubsub messages.
func NewMessage ¶
func (*Message) AnnotationsToObj ¶
func (*Message) Apply ¶
func (m *Message) Apply(opts ...MessageOption) error
Apply applies the given options to the config, returning the first error encountered (if any).
func (*Message) WithMessage ¶
type MessageHub ¶
type MessageHub struct {
sync.Mutex
Messages, PublicMessages chan *Message
// contains filtered or unexported fields
}
func NewHub ¶
func NewHub(otp string, maxsize, keyLength, interval int, joinPublic bool, opts ...Option) *MessageHub
func (*MessageHub) PublishMessage ¶
func (m *MessageHub) PublishMessage(mess *Message) error
func (*MessageHub) PublishPublicMessage ¶
func (m *MessageHub) PublishPublicMessage(mess *Message) error
type MessageOption ¶
type Option ¶
type Option func(*MessageHub)
Option configures a MessageHub at construction time.
func WithDirectPeers ¶
WithDirectPeers pins peers as gossipsub direct peers — the router holds a persistent connection to each and bypasses mesh negotiation for them, which makes pubsub delivery reliable to known/bootstrap peers even when the mesh (e.g. on a 2-node cluster) hasn't reached its target size.
Click to show internal directories.
Click to hide internal directories.