Documentation ¶
Index ¶
- Variables
- type Event
- func (e *Event) GetChannel() string
- func (e *Event) GetData() interface{}
- func (e *Event) GetDataString() string
- func (e *Event) GetEvent() string
- func (e *Event) SetChannel(channel string)
- func (e *Event) SetData(data interface{})
- func (e *Event) SetDataString(data string)
- func (e *Event) SetEvent(event string)
- type PublicChannel
- type PusherClient
- func (p *PusherClient) Bind(event string, h ws.Handler)
- func (p *PusherClient) BindAll(h ws.Handler)
- func (p *PusherClient) BindAllFunc(h func(ws.Event))
- func (p *PusherClient) BindFunc(event string, h func(ws.Event))
- func (p *PusherClient) Close()
- func (p *PusherClient) HandleConnected()
- func (p *PusherClient) HandleDisconnect() bool
- func (p *PusherClient) HandleMessage(msg []byte) error
- func (p *PusherClient) SendEvent(e ws.Event)
- func (p *PusherClient) SendMessage(msg []byte)
- func (p *PusherClient) SendPing()
- func (p *PusherClient) SendSubscribe(channel string)
- func (p *PusherClient) SendUnsubscribe(channel string)
- func (p *PusherClient) Subscribe(channel string) ws.Channel
- func (p *PusherClient) Unbind(event string, h ws.Handler)
- func (p *PusherClient) UnbindAll(h ws.Handler)
- func (p *PusherClient) UnbindAllFunc(h func(ws.Event))
- func (p *PusherClient) UnbindFunc(event string, h func(ws.Event))
- func (p *PusherClient) Unsubscribe(channel string)
- type PusherConfig
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 (*Event) GetDataString ¶
func (*Event) SetChannel ¶
func (*Event) SetDataString ¶
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) BindAll ¶
func (p *PusherClient) BindAll(h ws.Handler)
func (*PusherClient) BindAllFunc ¶
func (p *PusherClient) BindAllFunc(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) 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 ¶
func (PusherConfig) NewPusher ¶
func (p PusherConfig) NewPusher(appKey string) *PusherClient
func (PusherConfig) NewPusherUrl ¶
func (p PusherConfig) NewPusherUrl(pusherUrl string) (*PusherClient, error)
Click to show internal directories.
Click to hide internal directories.