helpers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SecretsPath = "/run/adi_secrets"

Variables

This section is empty.

Functions

This section is empty.

Types

type Depended

type Depended struct {
	Service   string
	Condition string
	Required  bool
	Restart   bool
}

type Env

type Env struct {
	Name  string
	Value *string
}

type HealthCheckConfig

type HealthCheckConfig struct {
	Cmd           []string
	Interval      time.Duration
	Timeout       time.Duration
	StartPeriod   time.Duration
	StartInterval time.Duration
	Retries       uint64
}

type Mapping

type Mapping map[string]string

func (Mapping) Values

func (m Mapping) Values() []string

type ModHelper

type ModHelper func(*composeTypes.Project) error

func CapAdd

func CapAdd(svcName string, caps ...string) ModHelper

func CapDrop

func CapDrop(svcName string, caps ...string) ModHelper

func CapDropAll

func CapDropAll(svcName string) ModHelper

func Command

func Command(svcName string, command []string) ModHelper

func ContainerName

func ContainerName(svcName string) ModHelper

func CustomLabels

func CustomLabels(svcName string, labels map[string]string) ModHelper

func DependsOn

func DependsOn(svcName string, dependsOnService ...Depended) ModHelper

func Entrypoint

func Entrypoint(svcName string, name string, args ...string) ModHelper

func Environment

func Environment(svcName string, envs ...Env) ModHelper

func Extension

func Extension(svcName, name string, v any) ModHelper

func HealthCheck

func HealthCheck(svcName string, conf HealthCheckConfig) ModHelper

func Hostname

func Hostname(svcName, hostname string) ModHelper

func Image

func Image(svcName, image string) ModHelper

func Labels

func Labels(svcName string, labels map[string]string) ModHelper

func MountTmpFs

func MountTmpFs(svcName string, mounts ...TmpFs) ModHelper

func Network

func Network(svcName, name string, conf *composeTypes.ServiceNetworkConfig) ModHelper

func Platform

func Platform(svcName, platform string) ModHelper

func Profiles

func Profiles(svcName string, profiles ...string) ModHelper

func ProjectNetwork

func ProjectNetwork(name string, conf *composeTypes.NetworkConfig) ModHelper

func ProjectSecrets

func ProjectSecrets(secrets ...Secret) ModHelper

func PublishPort

func PublishPort(svcName string, publishPort, targetPort uint16) ModHelper

func PullPolicy

func PullPolicy(svcName, pullPolicy string) ModHelper

func ReadOnlyRootFilesystem

func ReadOnlyRootFilesystem(svcName string) ModHelper

func RestartPolicy

func RestartPolicy(svcName, restartPolicy string) ModHelper

func Secrets

func Secrets(svcName string, secrets ...Secret) ModHelper

func SecretsPermission

func SecretsPermission(svcName string, secret Secret) ModHelper

func SecurityOpts

func SecurityOpts(svcName string, securityOpts ...string) ModHelper

func SecurityOptsNoNewPrivileges

func SecurityOptsNoNewPrivileges(svcName string) ModHelper

func User

func User(svcName, user, group string) ModHelper

func Volumes

func Volumes(svcName string, volumes ...string) ModHelper

type ModHelpers

type ModHelpers []ModHelper

func NewModHelpers

func NewModHelpers() ModHelpers

func (*ModHelpers) Apply

func (h *ModHelpers) Apply(prj *composeTypes.Project) error

type Secret

type Secret struct {
	Source     string
	Target     string
	EnvKey     string
	EnvFileKey string
	Value      string
	Rewrite    bool
	FileMode   int64
	UID        string
	GID        string
}

type TmpFs

type TmpFs struct {
	Target       string
	MountOptions Mapping
}

func (TmpFs) Mount

func (fs TmpFs) Mount() string

Jump to

Keyboard shortcuts

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