config

package
v0.0.0-...-d615174 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2019 License: MIT Imports: 28 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Path = "/etc/boss/boss.toml"
)

Variables

View Source
var ErrConfigStoreNotSupported = errors.New("config store not enabled, you need consul")

Functions

func RegisterName

func RegisterName(id string) string

Types

type Agent

type Agent struct {
	PlainRemotes []string `toml:"plain_remotes"`
	VolumeRoot   string   `toml:"volume_root"`
}

func (*Agent) Name

func (s *Agent) Name() string

func (*Agent) Remove

func (s *Agent) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Agent) Run

func (s *Agent) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type Buildkit

type Buildkit struct {
	Image string `toml:"image"`
}

func (*Buildkit) Name

func (s *Buildkit) Name() string

func (*Buildkit) Remove

func (s *Buildkit) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Buildkit) Run

func (s *Buildkit) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type CNI

type CNI struct {
	Image         string `toml:"image" json:"-"`
	Version       string `toml:"-" json:"cniVersion,omitempty"`
	NetworkName   string `toml:"name" json:"name"`
	Type          string `toml:"type" json:"type"`
	Master        string `toml:"master" json:"master,omitempty"`
	IPAM          IPAM   `toml:"ipam" json:"ipam"`
	Bridge        string `toml:"bridge" json:"bridge,omitempty"`
	BridgeAddress string `toml:"bridge_address" json:"-"`
}

func (*CNI) Bytes

func (c *CNI) Bytes() []byte

func (*CNI) Name

func (s *CNI) Name() string

func (*CNI) Remove

func (s *CNI) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*CNI) Run

func (s *CNI) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*CNI) SubSteps

func (c *CNI) SubSteps() (o []Step)

type Config

type Config struct {
	ID           string        `toml:"id"`
	Iface        string        `toml:"iface"`
	Domain       string        `toml:"domain"`
	Buildkit     *Buildkit     `toml:"buildkit"`
	CNI          *CNI          `toml:"cni"`
	Consul       *Consul       `toml:"consul"`
	NodeExporter *NodeExporter `toml:"nodeexporter"`
	Nameservers  []string      `toml:"nameservers"`
	Timezone     string        `toml:"timezone"`
	MOTD         *MOTD         `toml:"motd"`
	SSH          *SSH          `toml:"ssh"`
	Agent        Agent         `toml:"agent"`
	Containerd   Containerd    `toml:"containerd"`
	Criu         *Criu         `toml:"criu"`
}

func Load

func Load() (*Config, error)

Load the system config from disk fix up any missing fields with runtime data

func (*Config) GetNameservers

func (c *Config) GetNameservers() ([]string, error)

func (*Config) GetNetwork

func (c *Config) GetNetwork(name string) (v1.Network, error)

GetNetwork returns a network for the givin name

func (*Config) GetRegister

func (c *Config) GetRegister() (v1.Register, error)

func (*Config) Steps

func (c *Config) Steps() []Step

func (*Config) Store

func (c *Config) Store() (ConfigStore, error)

type ConfigStore

type ConfigStore interface {
	Write(context.Context, *v1.Container) error
	Watch(context.Context, containerd.Container, *v1.Container) (<-chan error, error)
}

type Consul

type Consul struct {
	Image    string   `toml:"image"`
	Join     []string `toml:"join"`
	NoServer bool     `toml:"no_server"`
	// contains filtered or unexported fields
}

func (*Consul) Name

func (s *Consul) Name() string

func (*Consul) Remove

func (s *Consul) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Consul) Run

func (s *Consul) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Consul) SubSteps

func (s *Consul) SubSteps() (o []Step)

type Containerd

type Containerd struct {
}

func (*Containerd) Name

func (s *Containerd) Name() string

func (*Containerd) Remove

func (s *Containerd) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Containerd) Run

func (s *Containerd) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type Criu

type Criu struct {
	Image    string `toml:"image"`
	Iptables string `toml:"iptables"`
}

func (*Criu) Name

func (s *Criu) Name() string

func (*Criu) Remove

func (s *Criu) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Criu) Run

func (s *Criu) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type DHCP

type DHCP struct {
}

func (*DHCP) Name

func (s *DHCP) Name() string

func (*DHCP) Remove

func (s *DHCP) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*DHCP) Run

func (s *DHCP) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type DNS

type DNS struct {
	ID string
}

func (*DNS) Name

func (s *DNS) Name() string

func (*DNS) Remove

func (s *DNS) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*DNS) Run

func (s *DNS) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type IPAM

type IPAM struct {
	Type   string `toml:"type" json:"type"`
	Subnet string `toml:"subnet" json:"subnet"`
}

type Join

type Join struct {
	IPs []string
}

func (*Join) Name

func (s *Join) Name() string

func (*Join) Remove

func (s *Join) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Join) Run

func (s *Join) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type MOTD

type MOTD struct {
	Banner string `toml:"banner"`
}

func (*MOTD) Name

func (m *MOTD) Name() string

func (*MOTD) Remove

func (s *MOTD) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*MOTD) Run

func (m *MOTD) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type Mkdir

type Mkdir struct {
}

func (*Mkdir) Name

func (s *Mkdir) Name() string

func (*Mkdir) Remove

func (s *Mkdir) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Mkdir) Run

func (s *Mkdir) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type NodeExporter

type NodeExporter struct {
	Image string `toml:"image"`
}

func (*NodeExporter) Name

func (s *NodeExporter) Name() string

func (*NodeExporter) Remove

func (s *NodeExporter) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*NodeExporter) Run

func (s *NodeExporter) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type RegisterService

type RegisterService struct {
	ID     string
	Port   int
	Tags   []string
	Config *Config
	Check  *v1.HealthCheck
}

func (*RegisterService) Name

func (s *RegisterService) Name() string

func (*RegisterService) Remove

func (s *RegisterService) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*RegisterService) Run

func (s *RegisterService) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type SSH

type SSH struct {
	Admin  string `toml:"admin"`
	Config bool   `toml:"sshd_config"`
}

func (*SSH) Name

func (m *SSH) Name() string

func (*SSH) Remove

func (s *SSH) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*SSH) Run

func (m *SSH) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type Step

type Step interface {
	Name() string
	Run(context.Context, *containerd.Client, *cli.Context) error
	Remove(context.Context, *containerd.Client, *cli.Context) error
}

type Systemd

type Systemd struct {
}

func (*Systemd) Name

func (s *Systemd) Name() string

func (*Systemd) Remove

func (s *Systemd) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Systemd) Run

func (s *Systemd) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

type Template

type Template struct {
	Index     uint64
	Container containerd.Container
	Name      string
	File      *v1.Config
	Data      []byte
	Spec      *oci.Spec
}

func (*Template) Render

func (t *Template) Render(ctx context.Context) error

func (*Template) Watch

func (t *Template) Watch(ctx context.Context, kv *api.KV, ch chan error)

type Timezone

type Timezone struct {
	TZ string
}

func (*Timezone) Name

func (s *Timezone) Name() string

func (*Timezone) Remove

func (s *Timezone) Remove(ctx context.Context, client *containerd.Client, clix *cli.Context) error

func (*Timezone) Run

func (s *Timezone) Run(ctx context.Context, client *containerd.Client, clix *cli.Context) error

Jump to

Keyboard shortcuts

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