ws

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Dial

func Dial(ctx context.Context, url string) (*Connection, error)

func NewConnection

func NewConnection(ctx context.Context, socket *websocket.Conn) *Connection

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) EmitClosing

func (c *Connection) EmitClosing()

func (*Connection) Id

func (c *Connection) Id() string

func (*Connection) OnClosing

func (c *Connection) OnClosing(onClosing func())

func (*Connection) ReadPump

func (c *Connection) ReadPump()

func (*Connection) SetOutput

func (c *Connection) SetOutput(out io.WriteCloser)

func (*Connection) Url

func (c *Connection) Url() string

func (*Connection) Write

func (c *Connection) Write(bytes []byte) (int, error)

func (*Connection) WritePump

func (c *Connection) WritePump()

type Hub

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

Hub maintains the set of active peers and broadcasts messages to the peers.

func NewHub

func NewHub(ctx context.Context, registry *remote.Registry) *Hub

func (*Hub) Close

func (h *Hub) Close()

func (*Hub) ServeHTTP

func (h *Hub) ServeHTTP(w http.ResponseWriter, r *http.Request)

type LockWriter

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

LockWriter is a writer that locks the underlying writer using a mutex.

func NewLockWriter

func NewLockWriter(writer io.Writer) *LockWriter

func (*LockWriter) Write

func (l *LockWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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