connection

package
v0.0.0-...-9465167 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	sync.Mutex

	SocketID  string
	Socket    Socket
	CreatedAt time.Time
}

Connection An user connection

func New

func New(socketID string, s Socket) *Connection

New Create a new Subscriber

func (*Connection) Publish

func (conn *Connection) Publish(m interface{})

Publish the message to websocket attached to this client

type Socket

type Socket interface {
	WriteJSON(interface{}) error
}

Socket interface to write to the client

Jump to

Keyboard shortcuts

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