pubsub

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Module is responsible for Pubsub

func Init

func Init(auth *auth.Module) *Module

Init returns a new instance of the Pubsub module

func (*Module) IsEnabled

func (m *Module) IsEnabled() bool

IsEnabled checks if the Pubsub module is enabled

func (*Module) Publish

func (m *Module) Publish(project, token, subject string, data interface{}) (int, error)

Publish publishes a byte array to a particular subject, if its permitted

func (*Module) QueueSubscribe

func (m *Module) QueueSubscribe(project, token, clientID, subject, queue string, cb model.PubsubCallback) (int, error)

QueueSubscribe subscribes to a particular subject (and its children) using a queue, if its permitted

func (*Module) SetConfig

func (m *Module) SetConfig(pubsub *config.Pubsub) error

SetConfig sets the config required by the Pubsub module

func (*Module) Subscribe

func (m *Module) Subscribe(project, token, clientID, subject string, cb model.PubsubCallback) (int, error)

Subscribe subscribes to a particular subject (and its children), if its permitted

func (*Module) Unsubscribe

func (m *Module) Unsubscribe(clientID, subject string) (int, error)

Unsubscribe unsubscribes a client from a particular subject

func (*Module) UnsubscribeAll

func (m *Module) UnsubscribeAll(clientID string) (int, error)

UnsubscribeAll unsubscribes a client from all subjects

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL