diambra

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerPort = "50051/tcp"
)
View Source
const DefaultEnvImage = "diambra/engine:main"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppArgs

type AppArgs struct {
	RandomSeed int
	Render     bool
	LockFPS    bool
	Sound      bool
}

func (AppArgs) Args

func (a AppArgs) Args() []string

type Args

type Args []string

func (*Args) Bool

func (a *Args) Bool(k string, v bool)

func (*Args) Int

func (a *Args) Int(k string, v int)

type Diambra

type Diambra struct {
	log.Logger

	container.Runner
	Envs []*Env
	// contains filtered or unexported fields
}

func NewDiambra

func NewDiambra(logger log.Logger, console console.Console, runner container.Runner, config *EnvConfig) (*Diambra, error)

func (*Diambra) Cleanup

func (e *Diambra) Cleanup() error

func (*Diambra) EnvsString

func (e *Diambra) EnvsString() (string, error)

FIXME: check errors earlier so we don't have to here

func (*Diambra) EnvsStringContainer

func (e *Diambra) EnvsStringContainer() (string, error)

FIXME: Merge with above

func (*Diambra) RandInt

func (d *Diambra) RandInt() (int, error)

func (*Diambra) RunAgentImage

func (e *Diambra) RunAgentImage(image string, args []string) error

func (*Diambra) Start

func (d *Diambra) Start() error

type Env

type EnvConfig

type EnvConfig struct {
	AppArgs AppArgs

	Scale      int
	AutoRemove bool
	AgentImage string
	PullImage  bool

	RomsPath string
	CredPath string
	Image    string

	User           string
	SeccompProfile string
	Output         *os.File
	Tty            bool // stdin is a terminal
	Interactive    bool // interaction requested

	Home     string
	Hostname string
	Mounts   []*container.BindMount
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() (*EnvConfig, error)

func (*EnvConfig) AddFlags

func (c *EnvConfig) AddFlags(flags *pflag.FlagSet)

func (*EnvConfig) AddRomsPathFlag

func (c *EnvConfig) AddRomsPathFlag(flags *pflag.FlagSet)

func (*EnvConfig) Validate

func (c *EnvConfig) Validate() error

Jump to

Keyboard shortcuts

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