protocol

package
v0.0.0-...-12a54d8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaPrefix             string = "/meta/"
	MetaService                   = "/service"
	MetaHandshakeChannel          = "handshake"
	MetaSubscribeChannel          = "subscribe"
	MetaUnsubscribeChannel        = "unsubscribe"
	MetaConnectChannel            = "connect"
	MetaDisconnectChannel         = "disconnect"
	MetaUnknownChannel            = "unknown"
)
View Source
const BayeuxVersion = "1.0"

Variables

View Source
var DefaultAdvice = Advice{Reconnect: "retry", Interval: 0, Timeout: 25000}

Functions

This section is empty.

Types

type Advice

type Advice struct {
	Reconnect string `json:"reconnect"`
	Interval  int    `json:"interval"`
	Timeout   int    `json:"timeout"`
}

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 uint32, logger utils.Logger) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

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

func (*Client) Id

func (c *Client) Id() uint32

func (*Client) ResetCounters

func (c *Client) ResetCounters() ClientCounters

func (*Client) Send

func (c *Client) Send(msg Message, jsonp string) bool

func (*Client) SetConnection

func (c *Client) SetConnection(connection Connection)

func (*Client) ShouldReap

func (c *Client) ShouldReap() bool

func (*Client) Subscribe

func (c *Client) Subscribe(patterns []string)

func (*Client) Subscriptions

func (c *Client) Subscriptions() []string

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(patterns []string)

type ClientCounters

type ClientCounters struct {
	Failed uint64
	Sent   uint64
}

type Connection

type Connection interface {
	Send([]Message) error
	SendJsonp([]Message, string) error
	IsConnected() bool
	IsSingleShot() bool
	Close()
}

type Message

type Message map[string]interface{}

func (Message) Channel

func (m Message) Channel() Channel

func (Message) ClientId

func (m Message) ClientId() uint32

func (Message) Jsonp

func (m Message) Jsonp() string

func (Message) SetClientId

func (m Message) SetClientId(clientId uint32)

func (Message) Update

func (m Message) Update(update Message)

type MetaChannel

type MetaChannel interface{}

type Subscription

type Subscription Channel

Jump to

Keyboard shortcuts

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