connect

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderClientName = "X-Snake-Client"

Variables

View Source
var ErrConnectionClosed = errors.New("connection has been closed")
View Source
var ErrWrongMsgType = errors.New("wrong message type")

Functions

This section is empty.

Types

type Connection

type Connection interface {
	Send(ctx context.Context, data interface{}) error
	Receive(ctx context.Context) ([]byte, error)
	Close(ctx context.Context) error
}

type Connector

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

func NewConnector

func NewConnector(cfg config.Target, clientName string) *Connector

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context, gameId int) (Connection, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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