pusher

package
v0.0.0-...-1979335 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel struct

func NewChannel

func NewChannel(ID string) *Channel

NewChannel constructor

func (*Channel) Join

func (c *Channel) Join(client *Client)

Join client to channel

func (*Channel) Leave

func (c *Channel) Leave(client *Client)

Leave client to channel

func (*Channel) Listen

func (c *Channel) Listen()

Listen channel

func (*Channel) Write

func (c *Channel) Write(event *message.Event)

Write to channel

type ChannelManager

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

ChannelManager struct

func NewChannelManager

func NewChannelManager() *ChannelManager

NewChannelManager constructor

func (*ChannelManager) Add

func (c *ChannelManager) Add(channel *Channel)

Add channel to manager

func (*ChannelManager) Get

func (c *ChannelManager) Get(ID string) (*Channel, bool)

Get channel by id

func (*ChannelManager) Remove

func (c *ChannelManager) Remove(channel *Channel)

Remove channel to manager

type Client

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

Client struct

func NewClient

func NewClient(ws *websocket.Conn, pusher *Pusher) *Client

NewClient constructor

func (*Client) Close

func (c *Client) Close()

Close client

func (*Client) Listen

func (c *Client) Listen()

Listen func

func (*Client) Write

func (c *Client) Write(event *message.Event)

Write event to client

type ClientManager

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

ClientManager struct

func NewClientManager

func NewClientManager() *ClientManager

NewClientManager constructor

func (*ClientManager) Add

func (c *ClientManager) Add(client *Client)

Add client to manager

func (*ClientManager) Clients

func (c *ClientManager) Clients() map[string]*Client

Clients list

func (*ClientManager) Remove

func (c *ClientManager) Remove(client *Client)

Remove client to manager

type Configuration

type Configuration struct {
}

Configuration struct

type ErrorHandler

type ErrorHandler func(w http.ResponseWriter, code int, err error)

ErrorHandler func

type Pusher

type Pusher struct {
	ErrorHandler ErrorHandler
	// contains filtered or unexported fields
}

Pusher struct

func NewPusher

func NewPusher(config Configuration) *Pusher

NewPusher server

func (*Pusher) JoinChannel

func (p *Pusher) JoinChannel(ID string, client *Client)

JoinChannel added client to channel

func (*Pusher) LeaveChannel

func (p *Pusher) LeaveChannel(ID string, client *Client)

LeaveChannel removed client to channel

func (*Pusher) ServeHTTP

func (p *Pusher) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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