client

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name       string          // Client nice name.
	ID         string          // Client unique ID.
	Connection *websocket.Conn // Client websocket connection.
}

Client is a pubsub service client.

func New

func New(name string, conn *websocket.Conn) *Client

New create a pubsub client. It generates an ID and assign it a name.

func (*Client) Send

func (client *Client) Send(message []byte) error

Send sends a message to a client.

func (*Client) String

func (client *Client) String() string

String is the Client structure stringer function.

Jump to

Keyboard shortcuts

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