model

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"`
	Tag            Tag                `bson:"tag,omitempty"`
	Name           string             `bson:"name,omitempty"`
	Secret         bool               `bson:"secret,omitempty"`
	CatDescription string             `bson:"cd,omitempty"`
	Author         string             `bson:"author,omitempty"`
}

type ChildConfig

type ChildConfig struct {
	Tag             Tag      `bson:"tag,omitempty"`
	Name            string   `bson:"name,omitempty"`
	Flags           []string `bson:"flags,omitempty"`
	EnvVar          string   `bson:"env,omitempty"`
	Points          uint     `bson:"points,omitempty"`
	Category        string   `bson:"category,omitempty"`
	TeamDescription string   `bson:"td,omitempty"`
	PreRequisites   []string `bson:"reqs,omitempty"`
	Outcomes        []string `bson:"outc,omitempty"`
}

type EnvVarConfig

type EnvVarConfig struct {
	EnvVar string `bson:"env,omitempty"`
	Value  string `bson:"value,omitempty"`
}

type Exercise

type Exercise struct {
	ID             primitive.ObjectID       `bson:"_id,omitempty"`
	Category       primitive.ObjectID       `bson:"categoryid,omitempty"`
	Tag            Tag                      `bson:"tag,omitempty"`
	Name           string                   `bson:"name,omitempty"`
	Secret         bool                     `bson:"secret,omitempty"`
	Status         bool                     `bson:"status,omitempty"`
	Static         bool                     `bson:"static,omitempty"`
	Difficulty     uint                     `bson:"difficulty,omitempty"`
	Instance       []ExerciseInstanceConfig `bson:"instance,omitempty"`
	OrgDescription string                   `bson:"od,omitempty"`
	Author         string                   `bson:"author,omitempty"`
}

type ExerciseInstanceConfig

type ExerciseInstanceConfig struct {
	Image    string         `bson:"image,omitempty"`
	MemoryMB uint           `bson:"memory,omitempty"`
	CPU      float64        `bson:"cpu,omitempty"`
	Envs     []EnvVarConfig `bson:"env,omitempty"`
	Children []ChildConfig  `bson:"children,omitempty"`
	Records  []RecordConfig `bson:"dns,omitempty"`
}

type ExerciseShort

type ExerciseShort struct {
	ID             primitive.ObjectID `bson:"_id,omitempty"`
	Category       primitive.ObjectID `bson:"categoryid,omitempty"`
	Tag            Tag                `bson:"tag,omitempty"`
	Name           string             `bson:"name,omitempty"`
	Secret         bool               `bson:"secret,omitempty"`
	Status         bool               `bson:"status,omitempty"`
	Static         bool               `bson:"static,omitempty"`
	Difficulty     uint               `bson:"difficulty,omitempty"`
	OrgDescription string             `bson:"od,omitempty"`
	Author         string             `bson:"author,omitempty"`
}

type RecordConfig

type RecordConfig struct {
	Type  string `bson:"type,omitempty"`
	Name  string `bson:"name,omitempty"`
	RData string `bson:"rdata,omitempty"`
}

type Tag

type Tag string

func NormalizeTag

func NormalizeTag[tag string | Tag](t tag) Tag

Jump to

Keyboard shortcuts

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