config

package
v0.0.0-...-34cf9b4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Root      = "/var/lib/boss"
	Extension = "io.boss/container"
)

Variables

This section is empty.

Functions

func WithBossConfig

func WithBossConfig(config *Container, image containerd.Image) containerd.NewContainerOpts

WithBossConfig is a containerd.NewContainerOpts for spec and container configuration

Types

type Check

type Check struct {
	Type     CheckType `toml:"type"`
	Interval int       `toml:"interval"`
	Timeout  int       `toml:"timeout"`
}

type CheckType

type CheckType string
const (
	HTTP CheckType = "http"
	TCP  CheckType = "tcp"
	GRPC CheckType = "grpc"
)

type Container

type Container struct {
	ID        string             `toml:"id"`
	Image     string             `toml:"image"`
	Resources *Resources         `toml:"resources"`
	GPUs      *GPUs              `toml:"gpus"`
	Mounts    []Mount            `toml:"mounts"`
	Env       []string           `toml:"env"`
	Args      []string           `toml:"args"`
	Labels    []string           `toml:"labels"`
	Network   NetworkType        `toml:"network"`
	Services  map[string]Service `toml:"services"`
}

type GPUs

type GPUs struct {
	Devices     []int    `toml:"devices"`
	Capbilities []string `toml:"capabilities"`
}

type Mount

type Mount struct {
	Type        string   `toml:"type"`
	Source      string   `toml:"source"`
	Destination string   `toml:"destination"`
	Options     []string `toml:"options"`
}

type NetworkType

type NetworkType string
const (
	Host NetworkType = "host"
	CNI  NetworkType = "cni"
	None NetworkType = ""
)

type Resources

type Resources struct {
	CPU    float64 `toml:"cpu"`
	Memory int64   `toml:"memory"`
	Score  int     `toml:"score"`
}

type Service

type Service struct {
	Port   int      `toml:"port"`
	Labels []string `toml:"labels"`
	Checks []Check  `toml:"checks"`
}

Jump to

Keyboard shortcuts

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