schema

package
v0.0.0-...-e2f5efa Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalScope  = "local"
	GlobalScope = "singleton"
)
View Source
const DefaultMode int64 = 0777
View Source
const (
	// PrefabGethMainnet causes the geth mainnet state to be included at /mnt/geth
	PrefabGethMainnet = "geth-mainnet"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InputFile

type InputFile struct {
	SourcePath      string `yaml:"source-path,omitempty" json:"path,omitempty"`
	DestinationPath string `yaml:"destination-path,omitempty" json:"destination-path,omitempty"`
	FileMode        string `yaml:"mode,omitempty" json:"mode,omitempty"`
}

func (InputFile) Destination

func (in InputFile) Destination() string

GetDestination makes it easy to change the name of the source member, as it is expected to change in the near future. (Also, there might be some logic behind it as well in the future)

func (InputFile) Mode

func (in InputFile) Mode() int64

Mode gets the Unix mode bits

func (InputFile) Source

func (in InputFile) Source() string

GetSource makes it easy to change the name of the source member, as it is expected to change in the near future. (Also, there might be some logic behind it as well in the future)

type Network

type Network struct {
	Name       string `yaml:"name,omitempty" json:"name,omitempty"`
	Bandwidth  string `yaml:"bandwidth,omitempty" json:"bandwidth,omitempty"`
	Latency    string `yaml:"latency,omitempty" json:"latency,omitempty"`
	PacketLoss string `yaml:"packet-loss,omitempty" json:"packet-loss,omitempty"`
}

func (Network) GetBandwidth

func (net Network) GetBandwidth() string

func (Network) GetLatency

func (net Network) GetLatency() (int64, error)

func (Network) GetPacketLoss

func (net Network) GetPacketLoss() (float64, error)

func (Network) HasEmulation

func (net Network) HasEmulation() bool

HasEmulation checks if the network struct has any emulation included

type Phase

type Phase struct {
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	Description string            `yaml:"description,omitempty" json:"description,omitempty"`
	System      []SystemComponent `yaml:"system,omitempty" json:"system,omitempty"`
	Remove      []string          `yaml:"remove,omitempty" json:"remove,omitempty"`
	Tasks       []Task            `yaml:"tasks,omitempty" json:"tasks,omitempty"`
	Duration    command.Duration  `yaml:"duration" json:"duration"`
}

type Resources

type Resources struct {
	Cpus    int64  `yaml:"cpus,omitempty" json:"cpus,omitempty"`
	Memory  string `yaml:"memory,omitempty" json:"memory,omitempty"`
	Storage string `yaml:"storage,omitempty" json:"storage,omitempty"`
	Prefab  string `yaml:"prefab,omitempty" json:"prefab,omitempty"`
}

type RootSchema

type RootSchema struct {
	EnvSubstitutions []string                  `yaml:"env-substitutions,omitempty" json:"env-substitutions,omitempty"`
	Substitutions    map[string]string         `yaml:"substitutions,omitempty" json:"substitutions,omitempty"`
	Services         []Service                 `yaml:"services,omitempty" json:"services,omitempty"`
	Sidecars         []Sidecar                 `yaml:"sidecars,omitempty" json:"sidecars,omitempty"`
	TaskRunners      []TaskRunner              `yaml:"task-runners,omitempty" json:"task-runners,omitempty"`
	Tests            []Test                    `yaml:"tests,omitempty" json:"tests,omitempty"`
	Integrations     integrations.Integrations `yaml:"integrations,omitempty" json:"integrations,omitempty"`
	Settings         Settings                  `yaml:"settings,omitempty" json:"settings,omitempty"`
}

type Script

type Script struct {
	SourcePath string `yaml:"source-path,omitempty" json:"path,omitempty"`
	Inline     string `yaml:"inline,omitempty" json:"inline,omitempty"`
}

type Service

type Service struct {
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	Description string            `yaml:"description,omitempty" json:"description,omitempty"`
	Volumes     []Volume          `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Resources   Resources         `yaml:"resources,omitempty" json:"resources,omitempty"`
	Args        []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty" json:"environment,omitempty"`
	Image       string            `yaml:"image,omitempty" json:"image,omitempty"`
	Script      Script            `yaml:"script,omitempty" json:"script,omitempty"`
	InputFiles  []InputFile       `yaml:"input-files,omitempty" json:"input-files,omitempty"`
	User        string            `yaml:"user,omitempty" json:"user,omitempty"`
}

type Settings

type Settings struct {
	CPUBinding bool `yaml:"cpu-binding,omitempty" json:"cpu-binding,omitempty"`
}

type Sidecar

type Sidecar struct {
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	Description string            `yaml:"description,omitempty" json:"description,omitempty"`
	SidecarTo   []string          `yaml:"sidecar-to,omitempty" json:"sidecar-to,omitempty"`
	Volumes     []Volume          `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Resources   Resources         `yaml:"resources,omitempty" json:"resources,omitempty"`
	Args        []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty" json:"environment,omitempty"`
	Image       string            `yaml:"image,omitempty" json:"image,omitempty"`
	Script      Script            `yaml:"script,omitempty" json:"script,omitempty"`
	InputFiles  []InputFile       `yaml:"input-files,omitempty" json:"input-files,omitempty"`
	User        string            `yaml:"user,omitempty" json:"user,omitempty"`
}

type SystemComponent

type SystemComponent struct {
	Type         string                   `yaml:"type,omitempty" json:"type,omitempty"`
	Name         string                   `yaml:"name,omitempty" json:"name,omitempty"`
	Count        int64                    `yaml:"count,omitempty" json:"count,omitempty"`
	Resources    SystemComponentResources `yaml:"resources,omitempty" json:"resources,omitempty"`
	PortMappings []string                 `yaml:"port-mappings,omitempty" json:"portMappings,omitempty"`
	Sidecars     []SystemComponentSidecar `yaml:"sidecars,omitempty" json:"sidecars,omitempty"`
	Args         []string                 `yaml:"args,omitempty" json:"args,omitempty"`
	Environment  map[string]string        `yaml:"environment,omitempty" json:"environment,omitempty"`
}

func (SystemComponent) GetCount

func (sc SystemComponent) GetCount() int64

func (SystemComponent) GetName

func (sc SystemComponent) GetName() string

func (SystemComponent) String

func (sc SystemComponent) String() string

type SystemComponentResources

type SystemComponentResources struct {
	Resources
	Networks []Network `yaml:"networks,omitempty" json:"networks,omitempty"`
}

type SystemComponentSidecar

type SystemComponentSidecar struct {
	Type        string            `yaml:"type,omitempty" json:"type,omitempty"`
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	Resources   Resources         `yaml:"resources,omitempty" json:"resources,omitempty"`
	Args        []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty" json:"environment,omitempty"`
}

type Task

type Task struct {
	Type           string            `yaml:"type,omitempty" json:"type,omitempty"`
	Description    string            `yaml:"description,omitempty" json:"description,omitempty"`
	IgnoreExitCode bool              `yaml:"ignore-exit-code,omitempty" json:"ignore-exit-code,omitempty"`
	Timeout        command.Timeout   `yaml:"timeout,omitempty" json:"timeout,omitempty"`
	Args           []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Environment    map[string]string `yaml:"environment,omitempty" json:"environment,omitempty"`
	Networks       []Network         `yaml:"networks,omitempty" json:"networks,omitempty"`
}

type TaskRunner

type TaskRunner struct {
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	Description string            `yaml:"description,omitempty" json:"description,omitempty"`
	Volumes     []Volume          `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Resources   Resources         `yaml:"resources,omitempty" json:"resources,omitempty"`
	Args        []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty" json:"environment,omitempty"`
	Image       string            `yaml:"image,omitempty" json:"image,omitempty"`
	Script      Script            `yaml:"script,omitempty" json:"script,omitempty"`
	InputFiles  []InputFile       `yaml:"input-files,omitempty" json:"input-files,omitempty"`
	User        string            `yaml:"user,omitempty" json:"user,omitempty"`
}

type Test

type Test struct {
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	Description string            `yaml:"description,omitempty" json:"description,omitempty"`
	System      []SystemComponent `yaml:"system,omitempty" json:"system,omitempty"`
	Phases      []Phase           `yaml:"phases,omitempty" json:"phases,omitempty"`
	Timeout     command.Timeout   `yaml:"timeout" json:"timeout"`
	WaitFor     command.Duration  `yaml:"wait-for" json:"waitFor"`
}

type Volume

type Volume struct {
	Path        string `yaml:"path,omitempty" json:"path,omitempty"`
	Name        string `yaml:"name,omitempty" json:"name,omitempty"`
	Permissions string `yaml:"permissions,omitempty" json:"permissions,omitempty"`
	Scope       string `yaml:"scope" json:"scope,omitempty"`
}

func (Volume) GetScope

func (sv Volume) GetScope() string

func (Volume) Local

func (sv Volume) Local() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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