socket

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package socket creates and manages Sockets from the client Each 'Socket' represents a single Socket on the client, and has its own websocket connection

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Socket

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

Socket struct for a single frontend Socket

func Create

func Create(configChan chan types.ClientMessage, conn *websocket.Conn) *Socket

Create creates a new Socket, with a valid api attached

func (*Socket) Close

func (w *Socket) Close() error

Closes the underlying websocket connection

func (*Socket) CloseChan

func (w *Socket) CloseChan() chan bool

func (*Socket) ConfigChan

func (w *Socket) ConfigChan() chan types.ClientMessage

func (*Socket) Read

func (w *Socket) Read()

func (*Socket) RemoteAddr

func (w *Socket) RemoteAddr() net.Addr

func (*Socket) Send

func (w *Socket) Send(msg interface{})

Send out to client through websocket

func (*Socket) SendErrorMessage

func (w *Socket) SendErrorMessage(err error)

SendErrorMessage sends the error message

func (*Socket) SendSuccess

func (w *Socket) SendSuccess(msg interface{}, position types.Position)

SendSuccess sends a success message

Jump to

Keyboard shortcuts

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