autobahn

package module
v0.0.0-...-27899c9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

README

GopherJS wrapper for autobahn.js

This project is not an implementation of Autobahn in Go, for that see turnpike.

This is a thin wrapper in GopherJS for the JavaScript websocket library Autobahn|JS. It is primarily for use in the browser but may work in node.js (I suppose).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseMessage

type CloseMessage struct {
	Reason       string
	CloseReason  string
	CloseMessage string
}

type Connection

type Connection struct {
	js.Object
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(url, realm string, options ...Option) *Connection

Create a new autobahn.Connection object. Options documentation http://autobahn.ws/js/reference.html#connection-options

func (*Connection) AddCloseListener

func (c *Connection) AddCloseListener(ch chan<- CloseMessage)

func (*Connection) Close

func (c *Connection) Close(options ...Option) error

Close a connection. Optional options: realm and message.

func (*Connection) GetSession

func (c *Connection) GetSession() *Session

func (*Connection) GetTransport

func (c *Connection) GetTransport() *Transport

func (*Connection) IsConnected

func (c *Connection) IsConnected() bool

func (*Connection) IsOpen

func (c *Connection) IsOpen() bool

func (*Connection) IsRetrying

func (c *Connection) IsRetrying() bool

func (*Connection) Open

func (c *Connection) Open() *Session

Open a connection. Creates a Cession.

type JSError

type JSError interface {
	js.Object
	error
}

func HandlePromise

func HandlePromise(p js.Object) (js.Object, JSError)

type Option

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

Optional options pair.

type Result

type Result struct {
	js.Object
}

type Session

type Session struct {
	js.Object
}

func (*Session) CallRPC

func (s *Session) CallRPC(procedure string, args []js.Object, kwargs js.Object, options ...Option) (*Result, JSError)

func (*Session) CallRPCProgressive

func (s *Session) CallRPCProgressive(procedure string, args []js.Object, kwargs js.Object, options ...Option) (<-chan *Result, <-chan JSError, <-chan js.Object)

func (*Session) GetId

func (s *Session) GetId() int

func (*Session) GetSubscriptions

func (s *Session) GetSubscriptions() []Subscription

func (*Session) IsOpen

func (s *Session) IsOpen() bool

func (*Session) Log

func (s *Session) Log(obj js.Object)

func (*Session) Prefix

func (s *Session) Prefix(prefix, uri string)

func (*Session) Publish

func (s *Session) Publish(topic string, args []js.Object, kwargs js.Object, options ...Option) (js.Object, JSError)

func (*Session) Subscribe

func (s *Session) Subscribe(topic string, ch chan<- *SubMessage, options ...Option) (*Subscription, error)

func (*Session) Unsubscribe

func (s *Session) Unsubscribe(sub *Subscription) (bool, error)

type SubMessage

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

type Subscription

type Subscription struct {
	js.Object
}

type Transport

type Transport struct {
	js.Object
}

func (*Transport) GetProtocol

func (t *Transport) GetProtocol() string

func (*Transport) GetType

func (t *Transport) GetType() string

func (*Transport) GetUrl

func (t *Transport) GetUrl() string

Jump to

Keyboard shortcuts

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