console

package
v0.0.0-...-8833268 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInternal = errors.New("console: internal error")
View Source
var ErrMalformedOutput = errors.New("console: recieved malformed output")
View Source
var ErrNoPlayer = errors.New("console: no player was found")
View Source
var ErrTimeout = errors.New("console: connection timeout")

Functions

This section is empty.

Types

type Admin

type Admin interface {
	Start(context.Context) error
	Restart(context.Context) error
	Stop(context.Context) error
	IsOnline(context.Context) (bool, error)
	Close() error
}

type GCP

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

func GCPOpen

func GCPOpen(project, instance, zone string) (*GCP, error)

func (GCP) Close

func (c GCP) Close() error

func (GCP) IsOnline

func (c GCP) IsOnline(ctx context.Context) (bool, error)

func (GCP) Restart

func (c GCP) Restart(ctx context.Context) error

func (GCP) Start

func (c GCP) Start(ctx context.Context) error

func (GCP) Stop

func (c GCP) Stop(ctx context.Context) error

type Local

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

func LocalOpen

func LocalOpen(containerID string) (*Local, error)

start, restart, stop, maybe see if it's on too? only to be used locally...

func (*Local) Close

func (c *Local) Close() error

func (*Local) IsOnline

func (c *Local) IsOnline(ctx context.Context) (bool, error)

func (*Local) Restart

func (c *Local) Restart(ctx context.Context) error

func (*Local) Start

func (c *Local) Start(ctx context.Context) error

func (*Local) Stop

func (c *Local) Stop(ctx context.Context) error

type NonAdmin

type NonAdmin interface {
	Players() ([]string, error)
	Seed() (string, error)
	Broadcast(msg string) error
	Message(user string, msg string) error
}

type RCON

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

func Open

func Open(port string, password string, timeout time.Duration) *RCON

func (*RCON) Broadcast

func (c *RCON) Broadcast(message string) error

func (*RCON) Message

func (c *RCON) Message(user string, message string) error

func (*RCON) Players

func (c *RCON) Players() ([]string, error)

"There are x users: Bob, April\n" // what if no users

func (*RCON) Seed

func (c *RCON) Seed() (string, error)

"Seed: [1871644822592853811]"

Jump to

Keyboard shortcuts

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