socket

package
v0.0.0-...-b4339e2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MSG

type MSG struct {
	MT int
	MD []byte
}

type Message

type Message struct {
	Data   []byte
	Socket *Socket
}

type Socket

type Socket struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, socket *websocket.Conn, leave chan *Socket, event chan *Message) *Socket

New - return new Socket connection

func (*Socket) Close

func (s *Socket) Close()

func (*Socket) Context

func (s *Socket) Context() context.Context

func (*Socket) Ping

func (s *Socket) Ping()

Ping connection to be online

func (*Socket) Read

func (s *Socket) Read() chan []byte

func (*Socket) Write

func (s *Socket) Write(msg []byte)

Jump to

Keyboard shortcuts

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