rcon

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthFailed          = errors.New("rcon: authentication failed")
	ErrInvalidAuthResponse = errors.New("rcon: invalid response type during auth")
	ErrUnexpectedFormat    = errors.New("rcon: unexpected response format")
	ErrCommandTooLong      = errors.New("rcon: command too long")
	ErrResponseTooLong     = errors.New("rcon: response too long")
)
View Source
var BuildVersion = "master"
View Source
var Config *rootConfig

Functions

func ReadConfig added in v1.0.4

func ReadConfig(cfgFile string) error

ReadConfig reads in config file and ENV variables if set.

Types

type RemoteConsole

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

func Dial

func Dial(ctx context.Context, host, password string, timeout time.Duration) (*RemoteConsole, error)

func (*RemoteConsole) Close

func (r *RemoteConsole) Close() error

func (*RemoteConsole) Exec

func (r *RemoteConsole) Exec(c string) (string, error)

func (*RemoteConsole) LocalAddr

func (r *RemoteConsole) LocalAddr() net.Addr

func (*RemoteConsole) Read

func (r *RemoteConsole) Read() (response string, requestID int, err error)

func (*RemoteConsole) RemoteAddr

func (r *RemoteConsole) RemoteAddr() net.Addr

func (*RemoteConsole) Write

func (r *RemoteConsole) Write(cmd string) (requestID int, err error)

type Server added in v1.0.4

type Server struct {
	Name     string `mapstructure:"name"`
	Host     string `mapstructure:"host"`
	Password string `mapstructure:"password"`
}

Jump to

Keyboard shortcuts

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