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: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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