script

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 17 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DESCRIPTION = "DESCRIPTION"
	VERSION     = "VERSION"
	SNAPSHOT    = "SNAPSHOT"
	REQUIRE_SVC = "REQUIRE_SVC"
	USE         = "SVC_USE"
	SVC_RUN     = "SVC_RUN"
	SVC_EXEC    = "SVC_EXEC"
	SVC_START   = "SVC_START"
	SVC_STOP    = "SVC_STOP"
	SVC_RESTART = "SVC_RESTART"
	SVC_WAIT    = "SVC_WAIT"
	DEPENDENCY  = "DEPENDENCY"

	EMPTY = "EMPTY"
)

Functions

func ForEachLine

func ForEachLine(r io.Reader, apply func(num int, line string) error) error

func ScriptStateToDesiredState

func ScriptStateToDesiredState(state ServiceState) (service.DesiredState, error)

Types

type Config

type Config struct {
	ServiceID      string
	DockerRegistry string            // docker registry being used for tagging images
	NoOp           bool              // Should commands modify the system
	TenantLookup   TenantIDLookup    // function for looking up a service
	Snapshot       Snapshot          // function for creating snapshots
	Commit         ContainerCommit   // function for committing a container
	Restore        SnapshotRestore   // function to do the rollback to a snapshot
	SvcIDFromPath  ServiceIDFromPath // function to find a service id from a path
	SvcStart       ServiceControl    // function to start a service
	SvcStop        ServiceControl    // function to stop a service
	SvcRestart     ServiceControl    // function to restart a service
	SvcWait        ServiceWait       // function to wait for a service to be in a desired state
	SvcUse         ServiceUse
}

type ContainerCommit

type ContainerCommit func(containerID string) (string, error)

Commit a container

type Runner

type Runner interface {
	Run(<-chan struct{}) error
}

func NewRunner

func NewRunner(r io.Reader, config *Config) (Runner, error)

func NewRunnerFromFile

func NewRunnerFromFile(fileName string, config *Config) (Runner, error)

type ServiceControl

type ServiceControl func(serviceID string, recursive bool) error

ServiceControl is a func used to control the state of a service

type ServiceIDFromPath

type ServiceIDFromPath func(tenantID string, path string) (string, error)

ServiceIDFromPath get a service id of a service given the tenant id the path to the services

type ServiceState

type ServiceState string

type ServiceUse

type ServiceUse func(tenantID string, serviceID string, imageID string, registry string, replaceImgs []string, noOp bool) (string, error)

ServiceUse is a func used to control the state of a service

type ServiceWait

type ServiceWait func(serviceID []string, serviceState ServiceState, timeout uint32, recursive bool) error

Wait for a service to be in a particular state

type Snapshot

type Snapshot func(serviceID string, description string, tag string) (string, error)

Snapshot an application

type SnapshotRestore

type SnapshotRestore func(snapshotID string, forceRestart bool) error

SnapshotRestore restore a given a snapshot ID.

type TenantIDLookup

type TenantIDLookup func(service string) (string, error)

Lookup a tenant ID given a service (name, id, or path)

Jump to

Keyboard shortcuts

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