bus

package
v0.0.0-...-79fff4a Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *config.Config) (*bus, error)

Types

type Bus

type Bus interface {
	Start()
	Publish(*Message) error
	Subscribe(*schema.User) *Subscription
	Unsubscribe(*Subscription)
	Stop() error
}

type Message

type Message struct {
	Command    string                 `json:"command"`
	State      string                 `json:"state"`
	Message    string                 `json:"message"`
	Attributes map[string]interface{} `json:"attributes"`
	CustomerID string                 `json:"customer_id"`
	BastionID  string                 `json:"bastion_id"`
}

func (*Message) Validate

func (msg *Message) Validate() error

type Subscription

type Subscription struct {
	CustomerID string
	Chan       chan *Message
}

Jump to

Keyboard shortcuts

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