pusher

package
v0.0.0-...-4601921 Latest Latest
Warning

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

Go to latest
Published: May 13, 2017 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultPusher = PusherConfig{
		Config: ws.Config{
			ConnectTimeout:  time.Second * 30,
			ActivityTimeout: time.Second * 120,
			PingTimeout:     time.Second * 30,
		},
		Client:   "pusher-websocket-go",
		Version:  "0.5",
		Protocol: 7,
	}
)

Functions

This section is empty.

Types

type Event

type Event struct {
	Event   string      `json:"event,omitempty"`
	Channel string      `json:"channel,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

func (*Event) GetChannel

func (e *Event) GetChannel() string

func (*Event) GetData

func (e *Event) GetData() interface{}

func (*Event) GetDataString

func (e *Event) GetDataString() string

func (*Event) GetEvent

func (e *Event) GetEvent() string

func (*Event) SetChannel

func (e *Event) SetChannel(channel string)

func (*Event) SetData

func (e *Event) SetData(data interface{})

func (*Event) SetDataString

func (e *Event) SetDataString(data string)

func (*Event) SetEvent

func (e *Event) SetEvent(event string)

type PublicChannel

type PublicChannel struct {
	ws.PublicChannel
}

func NewPublicChannel

func NewPublicChannel(channel string, client ws.ChannelClient) *PublicChannel

func (*PublicChannel) HandleEvent

func (c *PublicChannel) HandleEvent(event ws.Event)

type PusherClient

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

func NewPusher

func NewPusher(appKey string) *PusherClient

func NewPusherUrl

func NewPusherUrl(url string) (*PusherClient, error)

func (*PusherClient) Bind

func (p *PusherClient) Bind(event string, h ws.Handler)

func (*PusherClient) BindAll

func (p *PusherClient) BindAll(h ws.Handler)

func (*PusherClient) BindAllFunc

func (p *PusherClient) BindAllFunc(h func(ws.Event))

func (*PusherClient) BindFunc

func (p *PusherClient) BindFunc(event string, h func(ws.Event))

func (*PusherClient) Close

func (p *PusherClient) Close()

func (*PusherClient) HandleConnected

func (p *PusherClient) HandleConnected()

func (*PusherClient) HandleDisconnect

func (p *PusherClient) HandleDisconnect() bool

func (*PusherClient) HandleMessage

func (p *PusherClient) HandleMessage(msg []byte) error

func (*PusherClient) SendEvent

func (p *PusherClient) SendEvent(e ws.Event)

func (*PusherClient) SendMessage

func (p *PusherClient) SendMessage(msg []byte)

func (*PusherClient) SendPing

func (p *PusherClient) SendPing()

func (*PusherClient) SendSubscribe

func (p *PusherClient) SendSubscribe(channel string)

func (*PusherClient) SendUnsubscribe

func (p *PusherClient) SendUnsubscribe(channel string)

func (*PusherClient) Subscribe

func (p *PusherClient) Subscribe(channel string) ws.Channel

func (*PusherClient) Unbind

func (p *PusherClient) Unbind(event string, h ws.Handler)

func (*PusherClient) UnbindAll

func (p *PusherClient) UnbindAll(h ws.Handler)

func (*PusherClient) UnbindAllFunc

func (p *PusherClient) UnbindAllFunc(h func(ws.Event))

func (*PusherClient) UnbindFunc

func (p *PusherClient) UnbindFunc(event string, h func(ws.Event))

func (*PusherClient) Unsubscribe

func (p *PusherClient) Unsubscribe(channel string)

type PusherConfig

type PusherConfig struct {
	ws.Config
	Client   string
	Version  string
	Protocol int
}

func (PusherConfig) NewPusher

func (p PusherConfig) NewPusher(appKey string) *PusherClient

func (PusherConfig) NewPusherUrl

func (p PusherConfig) NewPusherUrl(pusherUrl string) (*PusherClient, error)

Jump to

Keyboard shortcuts

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