network

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Start() (err error)
	//Send a command to the websocket/archipelago server.
	SendCommand(api.Commands) (err error)
	//close the connection to the websocket/archipelago server.
	Close() (err error)
}

func NewClient

func NewClient(props ClientProps) (client Client, err error)

Test is a testing function to see if I can get archipelago BS to function.

type ClientImpl

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

func (*ClientImpl) Close

func (ci *ClientImpl) Close() (err error)

func (*ClientImpl) SendCommand

func (ci *ClientImpl) SendCommand(cmds api.Commands) (err error)

takes a command from the user and sends it to

func (*ClientImpl) Start

func (ci *ClientImpl) Start() (err error)

type ClientProps

type ClientProps struct {
	//The primary websocket url to connect to.
	Url string

	//CommandsCallback handles the list of commands that are returned.
	CommandsCallback func(ctx context.Context, cmds api.Commands)

	//CloseCallback Optional: will be called when the websocket client is closed.
	//May contain an error if the close was triggered by a send error
	CloseCallback func(err error)

	//Sets the context for the client request.
	RootContext context.Context

	// HTTPClient is used for the connection.
	// Its Transport must return writable bodies for WebSocket handshakes.
	// http.Transport does beginning with Go 1.12.
	HTTPClient *http.Client

	// HTTPHeader specifies the HTTP headers included in the handshake request.
	HTTPHeader http.Header

	// Host optionally overrides the Host HTTP header to send. If empty, the value
	// of URL.Host will be used.
	Host string

	Log utils.Logger
}

func (ClientProps) Validate

func (c ClientProps) Validate() (err error)

Jump to

Keyboard shortcuts

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