socket

package
v0.0.0-...-176a01d Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2017 License: MIT Imports: 6 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 {
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(ws *websocket.Conn, socket *Socket) (*Channel, error)

func (*Channel) Connect

func (c *Channel) Connect(msgCh chan *Message, doneCh chan bool) error

func (*Channel) Done

func (c *Channel) Done()

func (*Channel) HasRecipient

func (c *Channel) HasRecipient(id string) bool

func (*Channel) Listen

func (c *Channel) Listen()

func (*Channel) Write

func (c *Channel) Write(msg *Message) error

type Message

type Message struct {
	To   string `json:"to"`
	From string `json:"from"`
	Body string `json:"body"`
}

func (*Message) String

func (m *Message) String() string

type Socket

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

func NewSocket

func NewSocket() (*Socket, error)

func (*Socket) Add

func (s *Socket) Add(c *Channel)

func (*Socket) Del

func (s *Socket) Del(c *Channel)

func (*Socket) Done

func (s *Socket) Done()

func (*Socket) Err

func (s *Socket) Err(err error)

func (*Socket) GetChannels

func (s *Socket) GetChannels(c echo.Context) error

func (*Socket) HTTPForward

func (s *Socket) HTTPForward(c echo.Context) error

func (*Socket) HasRecipient

func (s *Socket) HasRecipient(id string) bool

func (*Socket) Listen

func (s *Socket) Listen(c echo.Context) error

Jump to

Keyboard shortcuts

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