controller

package
v0.0.0-...-9babe8c Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCreate = "create"
	ActionDelete = "delete"
	ActionUpdate = "update"
)

Variables

This section is empty.

Functions

func CreateCliArgs

func CreateCliArgs(eventData *Action) []string

func CreateEnvVars

func CreateEnvVars(eventData *Action) []string

func CreateExposedNetworkPorts

func CreateExposedNetworkPorts(eventData *Action) nat.PortSet

func CreateHostConfig

func CreateHostConfig(eventContext event.EventContext, eventData *Action) *container.HostConfig

func CreateImagePullOptions

func CreateImagePullOptions(eventData *Action) (image.PullOptions, error)

func CreateLabels

func CreateLabels(eventContext event.EventContext, eventData *Action) map[string]string

TODO include app.docker.io. prefix? (e.g. app.docker.io.name)

func CreatePortBindings

func CreatePortBindings(eventData *Action) nat.PortMap

func CreateWgHostConfig

func CreateWgHostConfig(containerName string, eventData *Action) *container.HostConfig

func CreateWgLabels

func CreateWgLabels(eventContext event.EventContext, eventData *Action) map[string]string

Types

type Action

type Action struct {
	Component string `json:"component"`
	Service   string `json:"service"`
	Action    string `json:"action"`
	Image     string `json:"image,omitempty"`
	// Configuration to use a private container image registry
	ImageRegistry ImageRegistry `json:"imageRegistry,omitempty"`
	// Deploy as a "K8s Job"
	IsJob bool `json:"isJob,omitempty"`
	// Ports to expose
	Ports []NetworkPort `json:"ports,omitempty"`
	// Expose the network ports outside the node
	ExposePorts bool `json:"exposePorts,omitempty"`
	// Environment variables
	EnvVars []KeyValue `json:"envVars,omitempty"`
	// CLI arguments
	CliArgs []KeyValue `json:"cliArgs,omitempty"`
	// Privileged opt
	Privileged bool `json:"privileged,omitempty"`
	// aeriOS network overlay configuration
	NetworkOverlay NetworkOverlay `json:"networkOverlay,omitempty"`
}

type Controller

type Controller struct {
	DockerClient *docker.DockerClient
}

func (*Controller) CreateContainerConfig

func (c *Controller) CreateContainerConfig(eventContext event.EventContext, eventData *Action) *container.Config

func (*Controller) CreateWgContainerConfig

func (c *Controller) CreateWgContainerConfig(eventContext event.EventContext, eventData *Action) *container.Config

func (*Controller) CreateWireguardConfigVolume

func (c *Controller) CreateWireguardConfigVolume(eventData *Action) error

func (*Controller) HandleAction

func (c *Controller) HandleAction(eventContext event.EventContext, eventData *Action) error

func (*Controller) HandleCreate

func (c *Controller) HandleCreate(eventContext event.EventContext, eventData *Action) error

func (*Controller) HandleDelete

func (c *Controller) HandleDelete(eventContext event.EventContext, eventData *Action) error

func (*Controller) HandleUpdate

func (c *Controller) HandleUpdate(eventContext event.EventContext, eventData *Action) error

func (*Controller) ProcessMessage

func (c *Controller) ProcessMessage(msg jetstream.Msg)

type ImageRegistry

type ImageRegistry struct {
	// Full url of the OCI image registry
	// Url string `json:"url,omitempty"`
	// User credentials
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type KeyValue

type KeyValue struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type Labels

type Labels struct {
}

type NetworkOverlay

type NetworkOverlay struct {
	InternalIp          string `json:"internalIp,omitempty"`
	Dns                 string `json:"dns,omitempty"`
	PublicKey           string `json:"publicKey,omitempty"`
	PrivateKey          string `json:"privateKey,omitempty"`
	Endpoint            string `json:"endpoint,omitempty"`
	Mtu                 int    `json:"mtu,omitempty"`
	AllowedIps          string `json:"allowedIps,omitempty"`
	PersistentKeepalive int    `json:"persistentKeepalive,omitempty"`
}

type NetworkPort

type NetworkPort struct {
	// Expose the network port outside the node
	// Expose       bool   `json:"expose"`
	// ExternalPort int32  `json:"externalPort,omitempty"`
	Number   int32  `json:"number,omitempty"`
	Protocol string `json:"protocol,omitempty"`
}

Jump to

Keyboard shortcuts

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