mgo_pubsub

package module
v0.0.0-...-0dd0f1c Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 7 Imported by: 1

README

mgo-pubsub

extreamly easy publish/subscribe messaging on mongodb

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Event     string    `json:"event" bson:"event"`
	Body      string    `json:"body" bson:"body"`
	Timestamp time.Time `json:"timestamp" bson:"timestamp"`
}

type PubSub

type PubSub struct {
	// contains filtered or unexported fields
}

func NewPubSub

func NewPubSub(address, database, collection string) (*PubSub, error)

func (*PubSub) Initialize

func (this *PubSub) Initialize() error

func (*PubSub) Publish

func (this *PubSub) Publish(event string, body string) error

func (*PubSub) StartPubSub

func (this *PubSub) StartPubSub() (err chan error)

func (*PubSub) Subscribe

func (this *PubSub) Subscribe(event string) *chan string

func (*PubSub) UnSubscribe

func (this *PubSub) UnSubscribe(event string, ch *chan string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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