protocol

package
v0.0.0-...-d2dfa33 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	META_PREFIX             string = "/meta/"
	META_SERVICE                   = "/service"
	META_HANDSHAKE_CHANNEL         = "handshake"
	META_SUBSCRIBE_CHANNEL         = "subscribe"
	META_CONNECT_CHANNEL           = "connect"
	META_DISCONNECT_CHANNEL        = "disconnect"
	META_UNKNOWN_CHANNEL           = "unknown"
)
View Source
const BAYEUX_VERSION = "1.0"

Variables

View Source
var DEFAULT_ADVICE = map[string]string{"reconnect": "retry", "interval": "0", "timeout": "10000"}

Functions

This section is empty.

Types

type Channel

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

func NewChannel

func NewChannel(name string) Channel

func (Channel) Expand

func (c Channel) Expand() []string

Returns all the channels patterns that could match this channel

For: /foo/bar We should return these: /** /foo/** /foo/* /foo/bar

func (Channel) IsMeta

func (c Channel) IsMeta() bool

func (Channel) IsService

func (c Channel) IsService() bool

func (Channel) MetaType

func (c Channel) MetaType() MetaChannel

func (Channel) Name

func (c Channel) Name() string

type Client

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

func NewClient

func NewClient(clientId string, msgStore MsgStore, logger utils.Logger) Client

func (*Client) Connect

func (c *Client) Connect(timeout int, interval int, responseMsg Message, connection Connection)

func (Client) Id

func (c Client) Id() string

func (Client) IsConnected

func (c Client) IsConnected() bool

func (Client) IsExpired

func (c Client) IsExpired() bool

func (Client) Queue

func (c Client) Queue(msg Message)

func (Client) QueueMany

func (c Client) QueueMany(msgs []Message)

func (*Client) SetConnection

func (c *Client) SetConnection(connection Connection)

type Connection

type Connection interface {
	Send([]Message) error
	IsConnected() bool
	IsSingleShot() bool
	Close()
	Priority() int
}

type Message

type Message map[string]interface{}

func (Message) Channel

func (m Message) Channel() Channel

func (Message) ClientId

func (m Message) ClientId() string

func (Message) SetClientId

func (m Message) SetClientId(clientId string)

func (Message) Update

func (m Message) Update(update map[string]interface{})

type MetaChannel

type MetaChannel interface{}

type MsgStore

type MsgStore interface {
	EnqueueMessages([]Message)
	GetAndClearMessages() []Message
}

type Session

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

Connect requests starts a session

func NewSession

func NewSession(client *Client, conn Connection, timeout int, response Message, logger utils.Logger) *Session

func (Session) End

func (s Session) End()

type Subscription

type Subscription Channel

Jump to

Keyboard shortcuts

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