module

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CPUArchMap = map[CPUArch]struct{}{
	X86:     {},
	I386:    {},
	X86_64:  {},
	AMD64:   {},
	AARCH32: {},
	ARM32V5: {},
	ARM32V6: {},
	ARM32V7: {},
	AARCH64: {},
	ARM64V8: {},
}
View Source
var DeploymentTypeMap = map[DeploymentType]struct{}{
	SingleDeployment:   {},
	MultipleDeployment: {},
}
View Source
var ModuleTypeMap = map[ModuleType]struct{}{
	AddOnModule:           {},
	DeviceConnectorModule: {},
}
View Source
var PortProtocolMap = map[PortProtocol]struct{}{
	TcpPort: {},
	UdpPort: {},
}

Functions

func GetServiceStartOrder

func GetServiceStartOrder(services map[string]*Service) ([]string, error)

Types

type BindMount

type BindMount struct {
	Source   string `json:"source"`
	ReadOnly bool   `json:"read_only"`
}

type CPUArch

type CPUArch = string
const (
	X86     CPUArch = "x86"
	I386    CPUArch = "i386"
	X86_64  CPUArch = "x86_64"
	AMD64   CPUArch = "amd64"
	AARCH32 CPUArch = "aarch32"
	ARM32V5 CPUArch = "arm32v5"
	ARM32V6 CPUArch = "arm32v6"
	ARM32V7 CPUArch = "arm32v7"
	AARCH64 CPUArch = "aarch64"
	ARM64V8 CPUArch = "arm64v8"
)

type ConfigTypeOptions

type ConfigTypeOptions map[string]configTypeOption

func (ConfigTypeOptions) SetBool

func (o ConfigTypeOptions) SetBool(ref string, val bool)

func (ConfigTypeOptions) SetFloat64

func (o ConfigTypeOptions) SetFloat64(ref string, val float64)

func (ConfigTypeOptions) SetInt64

func (o ConfigTypeOptions) SetInt64(ref string, val int64)

func (ConfigTypeOptions) SetString

func (o ConfigTypeOptions) SetString(ref string, val string)

type Configs

type Configs map[string]configValue

func (Configs) SetBool

func (c Configs) SetBool(ref string, def *bool, opt []bool, optExt bool, cType string, cTypeOpt ConfigTypeOptions, required bool)

func (Configs) SetBoolSlice

func (c Configs) SetBoolSlice(ref string, def []bool, opt []bool, optExt bool, cType string, cTypeOpt ConfigTypeOptions, delimiter string, required bool)

func (Configs) SetFloat64

func (c Configs) SetFloat64(ref string, def *float64, opt []float64, optExt bool, cType string, cTypeOpt ConfigTypeOptions, required bool)

func (Configs) SetFloat64Slice

func (c Configs) SetFloat64Slice(ref string, def []float64, opt []float64, optExt bool, cType string, cTypeOpt ConfigTypeOptions, delimiter string, required bool)

func (Configs) SetInt64

func (c Configs) SetInt64(ref string, def *int64, opt []int64, optExt bool, cType string, cTypeOpt ConfigTypeOptions, required bool)

func (Configs) SetInt64Slice

func (c Configs) SetInt64Slice(ref string, def []int64, opt []int64, optExt bool, cType string, cTypeOpt ConfigTypeOptions, delimiter string, required bool)

func (Configs) SetString

func (c Configs) SetString(ref string, def *string, opt []string, optExt bool, cType string, cTypeOpt ConfigTypeOptions, required bool)

func (Configs) SetStringSlice

func (c Configs) SetStringSlice(ref string, def []string, opt []string, optExt bool, cType string, cTypeOpt ConfigTypeOptions, delimiter string, required bool)

type DataType

type DataType = string
const (
	BoolType    DataType = "bool"
	Int64Type   DataType = "int"
	Float64Type DataType = "float"
	StringType  DataType = "string"
)

type DeploymentType

type DeploymentType = string
const (
	SingleDeployment   DeploymentType = "single"
	MultipleDeployment DeploymentType = "multiple"
)

type ExtDependencyTarget added in v0.4.0

type ExtDependencyTarget struct {
	ID      string `json:"id"`
	Service string `json:"service"`
}

type HttpEndpoint

type HttpEndpoint struct {
	Name string `json:"name"`
	Port *int   `json:"port"`
	Path string `json:"path"` // internal path
}

type Input

type Input struct {
	Name        string  `json:"name"`
	Description *string `json:"description"`
	Group       *string `json:"group"`
}

type InputGroup

type InputGroup struct {
	Name        string  `json:"name"`
	Description *string `json:"description"`
	Group       *string `json:"group"`
}

type Inputs

type Inputs struct {
	Resources map[string]Input      `json:"resources"` // {ref:Input}
	Secrets   map[string]Input      `json:"secrets"`   // {ref:Input}
	Configs   map[string]Input      `json:"configs"`   // {ref:Input}
	Groups    map[string]InputGroup `json:"groups"`    // {ref:InputGroup}
}

type Module

type Module struct {
	ID             string              `json:"id"`
	Name           string              `json:"name"`
	Description    string              `json:"description"`
	Tags           util.Set[string]    `json:"tags"`
	License        string              `json:"license"`
	Author         string              `json:"author"`
	Version        string              `json:"version"`
	Type           ModuleType          `json:"type"`
	DeploymentType DeploymentType      `json:"deployment_type"`
	Architectures  util.Set[CPUArch]   `json:"architectures"`
	Services       map[string]*Service `json:"services"`     // {ref:Service}
	Volumes        util.Set[string]    `json:"volumes"`      // {volName}
	Dependencies   map[string]string   `json:"dependencies"` // {moduleID:moduleVersion}
	Resources      map[string]Resource `json:"resources"`    // {ref:{tag}}
	Secrets        map[string]Secret   `json:"secrets"`      // {ref:Secret}
	Configs        Configs             `json:"configs"`      // {ref:ConfigValue}
	Inputs         Inputs              `json:"inputs"`
}

type ModuleType

type ModuleType = string
const (
	AddOnModule           ModuleType = "add-on"
	DeviceConnectorModule ModuleType = "device-connector"
)

type Port

type Port struct {
	Name     *string      `json:"name"`
	Number   uint         `json:"number"`
	Protocol PortProtocol `json:"protocol"`
	Bindings []uint       `json:"bindings"`
}

type PortProtocol

type PortProtocol = string
const (
	TcpPort PortProtocol = "tcp"
	UdpPort PortProtocol = "udp"
)

type Resource added in v0.6.0

type Resource struct {
	Tags     util.Set[string] `json:"tags"`
	Required bool             `json:"required"`
}

type ResourceTarget

type ResourceTarget struct {
	Ref      string `json:"ref"`
	ReadOnly bool   `json:"read_only"`
}

type RunConfig

type RunConfig struct {
	MaxRetries  uint          `json:"max_retries"`
	RunOnce     bool          `json:"run_once"`
	StopTimeout time.Duration `json:"stop_timeout"`
	StopSignal  *string       `json:"stop_signal"`
	PseudoTTY   bool          `json:"pseudo_tty"`
}

type Secret

type Secret struct {
	Type     string           `json:"type"`
	Tags     util.Set[string] `json:"tags"`
	Required bool             `json:"required"`
}

type Service

type Service struct {
	Name            string                         `json:"name"`
	Image           string                         `json:"image"`
	RunConfig       RunConfig                      `json:"run_config"`
	BindMounts      map[string]BindMount           `json:"bind_mounts"`      // {mntPoint:BindMount}
	Tmpfs           map[string]TmpfsMount          `json:"tmpfs"`            // {mntPoint:TmpfsMount}
	Volumes         map[string]string              `json:"volumes"`          // {mntPoint:volName}
	Resources       map[string]ResourceTarget      `json:"resources"`        // {mntPoint:ResourceTarget}
	Secrets         map[string]string              `json:"secrets"`          // {mntPoint:ref}
	Configs         map[string]string              `json:"configs"`          // {refVar:ref}
	SrvReferences   map[string]string              `json:"srv_references"`   // {refVar:ref}
	HttpEndpoints   map[string]HttpEndpoint        `json:"http_endpoints"`   // {externalPath:HttpEndpoint}
	RequiredSrv     util.Set[string]               `json:"required_srv"`     // {ref}
	RequiredBySrv   util.Set[string]               `json:"required_by_srv"`  // {ref}
	ExtDependencies map[string]ExtDependencyTarget `json:"ext_dependencies"` // {refVar:ExtDependencyTarget}
	Ports           []Port                         `json:"ports"`
}

type TmpfsMount

type TmpfsMount struct {
	Size uint64      `json:"size"`
	Mode fs.FileMode `json:"mode"`
}

Jump to

Keyboard shortcuts

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