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 ¶ added in v0.13.0
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 ¶ added in v0.11.0
type MessageHub struct {
sync.Mutex
Messages, PublicMessages chan *Message
// contains filtered or unexported fields
}
func NewHub ¶ added in v0.11.0
func NewHub(otp string, maxsize, keyLength, interval int, joinPublic bool, opts ...Option) *MessageHub
func (*MessageHub) PublishMessage ¶ added in v0.11.0
func (m *MessageHub) PublishMessage(mess *Message) error
func (*MessageHub) PublishPublicMessage ¶ added in v0.13.0
func (m *MessageHub) PublishPublicMessage(mess *Message) error
type MessageOption ¶
type Option ¶ added in v0.33.0
type Option func(*MessageHub)
Option configures a MessageHub at construction time.
func WithDirectPeers ¶ added in v0.33.0
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.