Documentation
¶
Index ¶
- Constants
- func ConnectWss(_url string, args url.Values) (*websocket.Conn, error)
- func GetElixirURL(_url string, args url.Values) (string, error)
- type Chan
- func (ch *Chan) GetRef() string
- func (ch *Chan) Join() (*Puller, error)
- func (ch *Chan) Leave() (*Puller, error)
- func (ch *Chan) OnEvent(evt string) *Puller
- func (ch *Chan) OnMessage() *Puller
- func (ch *Chan) Push(evt string, payload interface{}) error
- func (ch *Chan) PushWithRef(ref, evt *string, payload interface{}) error
- func (ch *Chan) Request(evt string, payload interface{}) (*Puller, error)
- type Client
- type Connection
- type Message
- type Puller
- type RegCenter
- type RegisterCenter
- type Socket
- type WSocket
- type Wss
Constants ¶
View Source
const ( // ChClosed channel closed ChClosed = "closed" // ChErrored channel errored ChErrored = "errored" // ChJoined channel joined ChJoined = "joined" // ChJoing channel joining ChJoing = "joining" // ChanClose channel close event ChanClose = "phx_close" // ChanError channel error event ChanError = "phx_error" // ChanReply server reply event ChanReply = "phx_reply" // ChanJoin client send join event ChanJoin = "phx_join" // ChanLeave client send leave event ChanLeave = "phx_leave" )
View Source
const ( // ConnConnecting linter ConnConnecting = "connecting" // ConnOpen linter ConnOpen = "open" // ConnClosing linter ConnClosing = "closing" // Connclosed linter Connclosed = "closed" )
Variables ¶
This section is empty.
Functions ¶
func ConnectWss ¶
ConnectWss linter
Types ¶
type Chan ¶
type Chan struct {
// contains filtered or unexported fields
}
Chan linter
func (*Chan) PushWithRef ¶
PushWithRef send a msg to channel
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client linter
type Connection ¶
type Connection interface { Chan(topic string) (*Chan, error) // Chan create a new channel on connection Push(msg *Message) error OnMessage() *Puller Close() error Start() }
Connection linter
type Message ¶
type Message struct { Topic string `mapstructure:"topic" json:"topic"` Event string `mapstructure:"event" json:"event"` Ref string `mapstructure:"ref" json:"ref"` Payload interface{} `mapstructure:"payload" json:"payload"` }
Message message
type Puller ¶
type Puller struct {
// contains filtered or unexported fields
}
Puller channel to receive result
type RegCenter ¶
RegCenter linter
func (*RegCenter) CloseAllPullers ¶
func (center *RegCenter) CloseAllPullers()
CloseAllPullers linter
func (*RegCenter) GetPullers ¶
GetPullers linter
func (*RegCenter) Unregister ¶
Unregister linter
type RegisterCenter ¶
type RegisterCenter interface { Register(key string) *Puller Unregister(puller *Puller) CloseAllPullers() GetPullers(key string) []*Puller }
RegisterCenter regis and unregis puller
Click to show internal directories.
Click to hide internal directories.