builders

package
v0.4.21 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Architecture

func Architecture(value, operator string) func(*latest.Constraints)

Architecture set the operating system constraint

func CPUs

func CPUs(cpus string) func(*latest.Resource)

CPUs sets the cup of the resource

func Command

func Command(s ...string) func(*latest.ServiceConfig)

Command sets the command of the service

func ConfigExternal

func ConfigExternal(c *latest.ConfigObjConfig)

ConfigExternal specifies that the config is external

func ConfigFile

func ConfigFile(path string) func(*latest.ConfigObjConfig)

ConfigFile specifies the path of a config

func ConfigGID

func ConfigGID(gid string) func(*latest.ServiceConfigObjConfig)

ConfigGID sets the gid of the config

func ConfigMode

func ConfigMode(mode uint32) func(*latest.ServiceConfigObjConfig)

ConfigMode sets the mode of the config

func ConfigSource

func ConfigSource(source string) func(*latest.ServiceConfigObjConfig)

ConfigSource sets the source of the config

func ConfigTarget

func ConfigTarget(target string) func(*latest.ServiceConfigObjConfig)

ConfigTarget sets the target of the config

func ConfigUID

func ConfigUID(uid string) func(*latest.ServiceConfigObjConfig)

ConfigUID sets the uid of the config

func ConstraintHostname

func ConstraintHostname(value, operator string) func(*latest.Constraints)

ConstraintHostname set the operating system constraint

func Constraints

func Constraints(builders ...func(*latest.Constraints)) func(*latest.Placement)

Constraints sets the constraints to the placement

func Daemonset

func Daemonset(owningStack *latest.Stack, name string, builders ...func(*appstypes.DaemonSet)) *appstypes.DaemonSet

Daemonset creates a core Deployment as if owned by a stack

func Deploy

func Deploy(builders ...func(*latest.DeployConfig)) func(*latest.ServiceConfig)

Deploy sets the deploy config of the service

func Deployment

func Deployment(owningStack *latest.Stack, name string, builders ...func(*appstypes.Deployment)) *appstypes.Deployment

Deployment creates a core Deployment as if owned by a stack

func Entrypoint

func Entrypoint(s ...string) func(*latest.ServiceConfig)

Entrypoint sets the entrypoint of the service

func Healthcheck

func Healthcheck(builders ...func(*latest.HealthCheckConfig)) func(*latest.ServiceConfig)

Healthcheck sets the healthcheck config of the service

func Hostname

func Hostname(hostname string) func(*latest.ServiceConfig)

Hostname sets the hostname of the service

func IPC

func IPC(mode string) func(*latest.ServiceConfig)

IPC sets the ipc mode of the service

func Image

func Image(reference string) func(*latest.ServiceConfig)

Image specfies the image of the service

func Interval

func Interval(duration time.Duration) func(*latest.HealthCheckConfig)

Interval sets the interval duration of the healthcheck

func Limits

func Limits(builders ...func(*latest.Resource)) func(*latest.Resources)

Limits sets the limits of the resources

func Memory

func Memory(memory int64) func(*latest.Resource)

Memory sets the memory of the resource

func ModeGlobal

func ModeGlobal(d *latest.DeployConfig)

ModeGlobal sets the deploy mode to global

func Mount

func Mount(v *latest.ServiceVolumeConfig)

Mount sets the volume type to mount

func OnFailure

func OnFailure(r *latest.RestartPolicy)

OnFailure sets the restart policy to on-failure

func OperatingSystem

func OperatingSystem(value, operator string) func(*latest.Constraints)

OperatingSystem set the operating system constraint

func PID

func PID(mode string) func(*latest.ServiceConfig)

PID sets the pid mode of the service

func Parallelism

func Parallelism(parallelism uint64) func(*latest.UpdateConfig)

Parallelism sets the parallelism of the update config

func Placement

func Placement(builders ...func(*latest.Placement)) func(*latest.DeployConfig)

Placement sets the placement of the deploy config

func Privileged

func Privileged(c *latest.ServiceConfig)

Privileged sets the service to privileged

func ProtocolUDP

func ProtocolUDP(c *latest.ServicePortConfig)

ProtocolUDP set's the port's protocol

func Published

func Published(published uint32) func(*latest.ServicePortConfig)

Published sets the published port

func PullPolicy added in v0.4.19

func PullPolicy(policy string) func(*latest.ServiceConfig)

PullPolicy specifies the pull policy used for this service

func PullSecret added in v0.4.19

func PullSecret(name string) func(*latest.ServiceConfig)

PullSecret specifies the name of the pull secret used for this service

func ReadOnly

func ReadOnly(c *latest.ServiceConfig)

ReadOnly sets the service to read only

func Replicas

func Replicas(replicas uint64) func(*latest.DeployConfig)

Replicas sets the number of replicas of a deploy config

func Reservations

func Reservations(builders ...func(*latest.Resource)) func(*latest.Resources)

Reservations sets the reservations of the resources

func Resources

func Resources(builders ...func(*latest.Resources)) func(*latest.DeployConfig)

Resources sets the resources of the deploy config

func RestartPolicy

func RestartPolicy(builders ...func(*latest.RestartPolicy)) func(*latest.DeployConfig)

RestartPolicy sets the restart policy of the deploy config

func Retries

func Retries(retries uint64) func(*latest.HealthCheckConfig)

Retries sets the number of retries of the healthcheck

func SecretFile

func SecretFile(path string) func(*latest.SecretConfig)

SecretFile specifies the path of a secret

func SecretSource

func SecretSource(source string) func(*latest.ServiceSecretConfig)

SecretSource sets the source of the secret

func SecretTarget

func SecretTarget(target string) func(*latest.ServiceSecretConfig)

SecretTarget sets the target of the secret

func Service

func Service(owningStack *latest.Stack, name string, builders ...func(*coretypes.Service)) *coretypes.Service

Service creates a core Service as if owned by a stack

func Source

func Source(source string) func(*latest.ServiceVolumeConfig)

Source sets the volume source

func Stack

func Stack(name string, builders ...func(*latest.Stack)) *latest.Stack

Stack is a builder to create an Stack

func Statefulset

func Statefulset(owningStack *latest.Stack, name string, builders ...func(*appstypes.StatefulSet)) *appstypes.StatefulSet

Statefulset creates a core Deployment as if owned by a stack

func StdinOpen

func StdinOpen(s *latest.ServiceConfig)

StdinOpen sets the service's stdin opne to true

func StopGracePeriod

func StopGracePeriod(duration time.Duration) func(*latest.ServiceConfig)

StopGracePeriod specifies the stop-grace-period duration of a service

func Target

func Target(target string) func(*latest.ServiceVolumeConfig)

Target sets the volume target

func Test

func Test(cmd ...string) func(*latest.HealthCheckConfig)

Test sets the test commands of the healthcheck

func Timeout

func Timeout(duration time.Duration) func(*latest.HealthCheckConfig)

Timeout sets the timeout duration of the healthcheck

func Tty

func Tty(s *latest.ServiceConfig)

Tty sets the service's tty to true

func Update

func Update(builders ...func(*latest.UpdateConfig)) func(*latest.DeployConfig)

Update sets the update config of a deploy config

func User

func User(user int64) func(*latest.ServiceConfig)

User specifies the user of a service

func Volume

func Volume(v *latest.ServiceVolumeConfig)

Volume sets the volume type to volume

func VolumeReadOnly

func VolumeReadOnly(v *latest.ServiceVolumeConfig)

VolumeReadOnly sets the volume to readonly

func WithCapAdd

func WithCapAdd(caps ...string) func(*latest.ServiceConfig)

WithCapAdd add a cap add to the service

func WithCapDrop

func WithCapDrop(caps ...string) func(*latest.ServiceConfig)

WithCapDrop adds a cap drop to the service

func WithConfig

func WithConfig(builders ...func(*latest.ServiceConfigObjConfig)) func(*latest.ServiceConfig)

WithConfig adds a config to the service

func WithConfigObjConfig

func WithConfigObjConfig(name string, builders ...func(*latest.ConfigObjConfig)) func(*latest.Stack)

WithConfigObjConfig add a ConfigConfig to to stack

func WithDeployLabel

func WithDeployLabel(key, value string) func(*latest.DeployConfig)

WithDeployLabel adds a label to the deploy config

func WithEnvironment

func WithEnvironment(key string, value *string) func(*latest.ServiceConfig)

WithEnvironment adds an environment variable to the service

func WithExtraHost

func WithExtraHost(host string) func(*latest.ServiceConfig)

WithExtraHost adds an extra host to the service

func WithInternalPort added in v0.4.21

func WithInternalPort(port int32, protocol corev1.Protocol) func(*latest.ServiceConfig)

WithInternalPort adds an internal port declaration

func WithLabel

func WithLabel(key, value string) func(*latest.ServiceConfig)

WithLabel adds a label to a service

func WithMatchLabel

func WithMatchLabel(key, value, operator string) func(*latest.Constraints)

WithMatchLabel adds the labels constraint to the constraint

func WithNamespace

func WithNamespace(namespace string) func(*latest.Stack)

WithNamespace set the namespace of the stack

func WithPort

func WithPort(target uint32, builders ...func(*latest.ServicePortConfig)) func(*latest.ServiceConfig)

WithPort adds a port config to the service

func WithSecret

func WithSecret(builders ...func(*latest.ServiceSecretConfig)) func(*latest.ServiceConfig)

WithSecret adds a secret to the service

func WithSecretConfig

func WithSecretConfig(name string, builders ...func(*latest.SecretConfig)) func(*latest.Stack)

WithSecretConfig add a SecretConfig to to stack

func WithService

func WithService(name string, builders ...func(*latest.ServiceConfig)) func(*latest.Stack)

WithService adds a ServiceConifg to the stack

func WithTmpFS

func WithTmpFS(path string) func(*latest.ServiceConfig)

WithTmpFS adds a path to the tmpfs of a service

func WithVolume

func WithVolume(builders ...func(*latest.ServiceVolumeConfig)) func(*latest.ServiceConfig)

WithVolume adds a volume to the service

func WorkingDir

func WorkingDir(w string) func(*latest.ServiceConfig)

WorkingDir sets the service's working folder

Types

This section is empty.

Jump to

Keyboard shortcuts

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