generic

package
v1.14.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.14.9

type Client interface {
	Address() string
	AdaptId() int
	SetAdaptId(adaptId int)

	Connection() (conn interface{})
	CloseConnection()

	Read(b []byte) (err error)
	ReadString() (message string)
	WriteString(message string)
	Receive() ([]byte, error)
	Send(msgToServer []byte) error
}

type Protocol added in v1.14.9

type Protocol interface {
	// Server Methods
	StartServer(ip, port string, initialConnections int)
	StopServer()
	AvailableConnectionFromPool() (available bool, idx int)
	WaitForConnection(cliIdx int) (cl *Client)

	GetClients() (clients []*Client)
	GetClient(idx int) (client Client)
	GetClientFromAddr(addr string) (client Client)
	AddClient(client Client, idx int)
	ResetClients() // Close connections and remove all clientes from the pool

	// Client Methods
	ConnectToServer(ip, port string)
	CloseConnection()

	ReadString() string
	WriteString(message string)
	Receive() ([]byte, error)
	Send(msgToServer []byte) error
}

type Proxy

type Proxy interface {
	Configure(config ProxyConfig)
}

type ProxyConfig

type ProxyConfig struct {
	Host      string
	Port      string
	ProxyName string
}

Jump to

Keyboard shortcuts

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