Documentation ¶
Index ¶
- Variables
- func CreateContainer(ctx context.Context, conf virtual.ContainerConfig) (*virtual.Container, error)
- func NewTag(s string) (string, error)
- func ValidateTag(t string) error
- type ChildExercise
- type ChildrenChalConfig
- type ContainerOptions
- type EmptyVarErr
- type EnvVarConfig
- type Exercise
- func (e *Exercise) Close() error
- func (e *Exercise) Create(ctx context.Context) error
- func (e *Exercise) GetChildExercises() []ChildExercise
- func (e *Exercise) InstanceInfo() []virtual.InstanceInfo
- func (e *Exercise) Reset(ctx context.Context) error
- func (e *Exercise) Start(ctx context.Context) error
- func (e *Exercise) Stop(ctx context.Context) error
- type ExerciseConfig
- type ExerciseInstanceConfig
- type Flag
- type InvalidTagSyntaxErr
- type RecordConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DuplicateTagErr = errors.New("Tag already exists") MissingTagsErr = errors.New("No tags, need atleast one tag") UnknownTagErr = errors.New("Unknown tag") RegistryLink = "registry.gitlab.com" OvaSuffix = ".ova" )
View Source
var (
ErrInvalidFlagFormat = errors.New("Invalid flag format")
)
TODO add comments
View Source
var (
TagEmptyErr = errors.New("Tag cannot be empty")
)
Functions ¶
func CreateContainer ¶
func ValidateTag ¶
Types ¶
type ChildExercise ¶
type ChildrenChalConfig ¶
type ContainerOptions ¶
type ContainerOptions struct { DockerConf virtual.ContainerConfig Records []RecordConfig ChildExercises []ChildExercise }
type EmptyVarErr ¶
func (*EmptyVarErr) Error ¶
func (eve *EmptyVarErr) Error() string
type EnvVarConfig ¶
type Exercise ¶
type Exercise struct { ContainerOpts []ContainerOptions VboxOpts []ExerciseInstanceConfig Tag string Vlib *virtual.VboxLibrary Net *virtual.Network DnsAddr string DnsRecords []RecordConfig Ips []int Machines []virtual.Instance }
todo manage exercise status somehow
func NewExercise ¶
func NewExercise(conf ExerciseConfig, vlib *virtual.VboxLibrary, net *virtual.Network, dnsAddr string) *Exercise
TODO add comments
func (*Exercise) GetChildExercises ¶
func (e *Exercise) GetChildExercises() []ChildExercise
func (*Exercise) InstanceInfo ¶
func (e *Exercise) InstanceInfo() []virtual.InstanceInfo
type ExerciseConfig ¶
type ExerciseConfig struct { Tag string `json:"tag,omitempty"` // specifies whether challenge will be on docker/vm or none // true: none , false: docker/vm Static bool `json:"static,omitempty"` Instance []ExerciseInstanceConfig `json:"instance,omitempty"` }
func (ExerciseConfig) CreateContainerOpts ¶
func (e ExerciseConfig) CreateContainerOpts() []ContainerOptions
type ExerciseInstanceConfig ¶
type ExerciseInstanceConfig struct { Image string `json:"image,omitempty"` MemoryMB uint `json:"memory,omitempty"` CPU float64 `json:"cpu,omitempty"` Envs []EnvVarConfig `json:"envs,omitempty"` Flags []ChildrenChalConfig `json:"children,omitempty"` Records []RecordConfig `json:"records,omitempty"` }
type InvalidTagSyntaxErr ¶
type InvalidTagSyntaxErr struct {
// contains filtered or unexported fields
}
func (*InvalidTagSyntaxErr) Error ¶
func (ite *InvalidTagSyntaxErr) Error() string
type RecordConfig ¶
Click to show internal directories.
Click to hide internal directories.