Help us shape the future of Go! Take the 2026 Go Developer Survey

connector

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 4 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 {
	Name string
	// contains filtered or unexported fields
}

Connection struct contains all variables necessary for the connection

func (*Connection) Close

func (c *Connection) Close()

Close closes a single connection

func (*Connection) Get

func (c *Connection) Get(cmd string) (string, error)

Get return rcon command response

type ConnectionOptions

type ConnectionOptions struct {
	Addr                 string
	RCONPassword         string
	ConnectTimeout       time.Duration
	CacheExpiration      time.Duration
	CacheCleanupInterval time.Duration
}

ConnectionOptions options for a Connection

type Connector

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

Connector struct contains the connections

func NewConnector

func NewConnector() *Connector

NewConnector creates a new Connector object

func (*Connector) CloseAll

func (cn *Connector) CloseAll()

CloseAll closes all open connections

func (*Connector) GetConnections

func (cn *Connector) GetConnections() (map[string]*Connection, error)

GetConnections holds all connections and reconnects/reopens them if necessary

func (*Connector) NewConnection

func (cn *Connector) NewConnection(name string, opts *ConnectionOptions) error

NewConnection Add a new connection and initiates first contact connection

Jump to

Keyboard shortcuts

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