compose

package
v0.0.0-...-b60b6a8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XSNone        ExecutionState = "xs.none"
	XSCreated                    = "xs.created"
	XSStarted                    = "xs.started"
	XSStopping                   = "xs.stopping"
	XSStopped                    = "xs.stopped"
	XSRemoved                    = "xs.removed"
	XSExited                     = "xs.exited"
	XSExitedCrash                = "xs.exited.crash"
	XSError                      = "xs.error"
)
View Source
const (
	XECreated     ExecutionEvent = "xe.container.created"
	XEStarted                    = "xe.container.started"
	XEStopping                   = "xe.container.stopping"
	XEStopped                    = "xe.container.stopped"
	XERemoved                    = "xe.container.removed"
	XEExited                     = "xe.container.exited"
	XEExitedCrash                = "xe.container.exited.crash"
	XEAPIError                   = "xe.api.error"
	XEInterrupt                  = "xe.interrupt"
)
View Source
const (
	ComposeVerUnknown = 0
	ComposeVerOne     = 1
	ComposeVerTwo     = 2
	ComposeVerThree   = 3
)
View Source
const (
	ComposeVerOneStr   = "1"
	ComposeVerTwoStr   = "2"
	ComposeVerThreeStr = "3"
)

Variables

View Source
var ErrNoServiceImage = errors.New("no service image")

Functions

func EnvVarsFromService

func EnvVarsFromService(varMap types.MappingWithEquals, varFiles types.StringList) []string

func ExposedPorts

func ExposedPorts(expose types.StringOrNumberList, ports []types.ServicePortConfig) map[dockerapi.Port]struct{}

func HasImage

func HasImage(dclient *dockerapi.Client, imageRef string) (bool, error)

func MountsFromVolumeConfigs

func MountsFromVolumeConfigs(
	baseComposeDir string,
	configs []types.ServiceVolumeConfig,
	tmpfsConfigs []string,
	activeVolumes map[string]*ActiveVolume) ([]dockerapi.HostMount, error)

func VolumesFrom

func VolumesFrom(serviceNames map[string]struct{},
	volumesFrom []string) []string

Types

type ActiveNetwork

type ActiveNetwork struct {
	Name    string //full network name
	ID      string
	Created bool
}

type ActiveVolume

type ActiveVolume struct {
	Name string
	ID   string
}

type ConfigInfo

type ConfigInfo struct {
	BaseComposeDir string
	Version        uint
	FullVersion    string
	Project        *types.Project
	Raw            map[string]interface{}
	RawList        []map[string]interface{}
}

func NewConfigInfo

func NewConfigInfo(
	composeFiles []string,
	projectName string,
	workingDir string,
	envVars []string,
	environmentNoHost bool,
) (*ConfigInfo, error)

type Execution

type Execution struct {
	*ConfigInfo
	State             ExecutionState
	Selectors         *ServiceSelectors
	BuildImages       bool
	PullImages        bool
	OwnAllResources   bool
	AllServiceNames   map[string]struct{}
	AllServices       map[string]*ServiceInfo
	AllNetworks       map[string]*NetworkInfo
	PendingServices   map[string]struct{}
	RunningServices   map[string]*RunningService
	ActiveVolumes     map[string]*ActiveVolume
	ActiveNetworks    map[string]*ActiveNetwork
	StopTimeout       uint
	ContainerProbeSvc string
	// contains filtered or unexported fields
}

func NewExecution

func NewExecution(
	xc *app.ExecutionContext,
	logger *log.Entry,
	apiClient *dockerapi.Client,
	composeFiles []string,
	selectors *ServiceSelectors,
	projectName string,
	workingDir string,
	envVars []string,
	environmentNoHost bool,
	containerProbeComposeSvc string,
	buildImages bool,
	pullImages bool,
	pullExcludes []string,
	ownAllResources bool,
	options *ExecutionOptions,
	eventCh chan *ExecutionEvenInfo,
	printState bool) (*Execution, error)

func (*Execution) ActiveNetworkNames

func (ref *Execution) ActiveNetworkNames() map[string]string

func (*Execution) ActiveServiceNetworks

func (ref *Execution) ActiveServiceNetworks(svcName string) map[string]NetNameInfo

func (*Execution) Cleanup

func (ref *Execution) Cleanup() error

func (*Execution) CleanupService

func (ref *Execution) CleanupService(key string) error

func (*Execution) CleanupServices

func (ref *Execution) CleanupServices() error

func (*Execution) CreateNetworks

func (ref *Execution) CreateNetworks() error

func (*Execution) CreateVolumes

func (ref *Execution) CreateVolumes() error

func (*Execution) DeleteNetworks

func (ref *Execution) DeleteNetworks() error

func (*Execution) DeleteVolumes

func (ref *Execution) DeleteVolumes() error

func (*Execution) DiscoverResources

func (ref *Execution) DiscoverResources() error

func (*Execution) Prepare

func (ref *Execution) Prepare() error

func (*Execution) PrepareService

func (ref *Execution) PrepareService(ctx context.Context, name string) error

func (*Execution) PrepareServices

func (ref *Execution) PrepareServices() error

func (*Execution) ProjectName

func (ref *Execution) ProjectName() string

func (*Execution) ProjectWorkingDir

func (ref *Execution) ProjectWorkingDir() string

func (*Execution) SelectedHaveImages

func (ref *Execution) SelectedHaveImages() bool

func (*Execution) Service

func (ref *Execution) Service(name string) *ServiceInfo

func (*Execution) Start

func (ref *Execution) Start() error

func (*Execution) StartService

func (ref *Execution) StartService(name string) error

func (*Execution) StartServices

func (ref *Execution) StartServices() error

func (*Execution) Stop

func (ref *Execution) Stop() error

func (*Execution) StopService

func (ref *Execution) StopService(key string) error

func (*Execution) StopServices

func (ref *Execution) StopServices() error

type ExecutionEvenInfo

type ExecutionEvenInfo struct {
	Event ExecutionEvent
	Data  map[string]string
}

type ExecutionEvent

type ExecutionEvent string

type ExecutionOptions

type ExecutionOptions struct {
}

type ExecutionState

type ExecutionState string

type ImageIdentity

type ImageIdentity struct {
	ID           string
	ShortTags    []string
	RepoTags     []string
	ShortDigests []string
	RepoDigests  []string
}

func ImageToIdentity

func ImageToIdentity(info *dockerapi.Image) *ImageIdentity

type LoaderOptionsFn

type LoaderOptionsFn func(opts *loader.Options)

type NetNameInfo

type NetNameInfo struct {
	FullName string
	Aliases  []string
}

type NetworkInfo

type NetworkInfo struct {
	Name   string
	Config types.NetworkConfig
}

type RunningService

type RunningService struct {
	Name          string
	ID            string
	ContainerName string
}

type ServiceInfo

type ServiceInfo struct {
	Selected        bool
	ShortName       string
	Name            string
	ContainerName   string
	AllDependencies []string
	Config          types.ServiceConfig
}

type ServiceSelectors

type ServiceSelectors struct {
	Includes       map[string]struct{}
	Excludes       map[string]struct{}
	ServiceAllDeps string
}

func NewServiceSelectors

func NewServiceSelectors(serviceAllDeps string,
	includes []string,
	excludes []string) *ServiceSelectors

Jump to

Keyboard shortcuts

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