protocol

package
v0.0.0-...-4d20082 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Host     string
	Password string
	Port     int
	Timeout  time.Time
}

Options for the remote connection to be stablished

type RemoteConnection

type RemoteConnection struct {
	sync.Mutex
	// contains filtered or unexported fields
}

RemoteConnection to a Source server

func New

func New(opts *Options) *RemoteConnection

New creates a new RCON for the given host and port.

func (*RemoteConnection) Close

func (r *RemoteConnection) Close() error

Close closes the server connection

func (*RemoteConnection) ExecCommand

func (r *RemoteConnection) ExecCommand(cmd string) ([]byte, error)

ExecCommand sends a command to the server. When this command is executed it will check if the connection is authenticated or needs to be authenticated. Note that this method makes exclusive use of the underlying connection to make it safe to use in a multi routine scenario.

Jump to

Keyboard shortcuts

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