contracts

package
v0.0.0-...-15b5fa4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequestMaker

type APIRequestMaker interface {
	Request(ctx context.Context, request domain.APIRequest) (APIResponse, error)
}

type APIResponse

type APIResponse interface {
	Body() []byte
	Status() string
	StatusCode() int

	Error() interface{}
}

type Cache

type Cache interface {
	Set(ctx context.Context, key string, val interface{}, ttl time.Duration)
	Get(ctx context.Context, key string)
	Delete(ctx context.Context, key string)
}

type CommandResultReader

type CommandResultReader interface {
	OutputReader
	Result() int
	IsComplete() bool
}

type DomainPrimitiveValidator

type DomainPrimitiveValidator interface {
	Validate() error
}

type Executor

type Executor interface {
	Exec(ctx context.Context, command string, options ExecutorOptions) ([]byte, int, error)
	ExecWithWriter(ctx context.Context, command string, out io.Writer, options ExecutorOptions) (int, error)
}

type ExecutorOptions

type ExecutorOptions struct {
	Env             map[string]string
	WorkDir         string
	FallbackWorkDir string
	UID             string
	GID             string
}

type GameServerCommand

type GameServerCommand interface {
	CommandResultReader

	Execute(ctx context.Context, server *domain.Server) error
}

type OutputReader

type OutputReader interface {
	ReadOutput() []byte
}

type ProcessManager

type ProcessManager interface {
	Install(ctx context.Context, server *domain.Server, out io.Writer) (domain.Result, error)
	Uninstall(ctx context.Context, server *domain.Server, out io.Writer) (domain.Result, error)

	Start(ctx context.Context, server *domain.Server, out io.Writer) (domain.Result, error)
	Stop(ctx context.Context, server *domain.Server, out io.Writer) (domain.Result, error)
	Restart(ctx context.Context, server *domain.Server, out io.Writer) (domain.Result, error)
	Status(ctx context.Context, server *domain.Server, out io.Writer) (domain.Result, error)
	GetOutput(ctx context.Context, server *domain.Server, out io.Writer) (domain.Result, error)
	SendInput(ctx context.Context, input string, server *domain.Server, out io.Writer) (domain.Result, error)
}

type Store

type Store interface {
	Set(ctx context.Context, key string, val interface{})
	Get(ctx context.Context, key string)
	Delete(ctx context.Context, key string)
}

Jump to

Keyboard shortcuts

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