Documentation
¶
Index ¶
- Constants
- Variables
- func GetImageNameOrDefault(service types.ServiceConfig, projectName string) string
- func IsAlreadyExistsError(err error) bool
- func IsErrCanceled(err error) bool
- func IsErrNotImplemented(err error) bool
- func IsErrParsingFailed(err error) bool
- func IsErrUnsupportedFlag(err error) bool
- func IsForbiddenError(err error) bool
- func IsNotFoundError(err error) bool
- func IsUnknownError(err error) bool
- type BuildOptions
- type ConfigOptions
- type ContainerEvent
- type ContainerEventListener
- type ContainerProcSummary
- type ContainerSummary
- type CopyOptions
- type CreateOptions
- type DownOptions
- type DryRunClient
- func (d *DryRunClient) BuildCachePrune(ctx context.Context, opts moby.BuildCachePruneOptions) (*moby.BuildCachePruneReport, error)
- func (d *DryRunClient) BuildCancel(ctx context.Context, id string) error
- func (d *DryRunClient) CheckpointCreate(ctx context.Context, container string, options moby.CheckpointCreateOptions) error
- func (d *DryRunClient) CheckpointDelete(ctx context.Context, container string, options moby.CheckpointDeleteOptions) error
- func (d *DryRunClient) CheckpointList(ctx context.Context, container string, options moby.CheckpointListOptions) ([]moby.Checkpoint, error)
- func (d *DryRunClient) ClientVersion() string
- func (d *DryRunClient) Close() error
- func (d *DryRunClient) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (moby.ConfigCreateResponse, error)
- func (d *DryRunClient) ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error)
- func (d *DryRunClient) ConfigList(ctx context.Context, options moby.ConfigListOptions) ([]swarm.Config, error)
- func (d *DryRunClient) ConfigRemove(ctx context.Context, id string) error
- func (d *DryRunClient) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error
- func (d *DryRunClient) ContainerAttach(ctx context.Context, container string, options moby.ContainerAttachOptions) (moby.HijackedResponse, error)
- func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options moby.ContainerCommitOptions) (moby.IDResponse, error)
- func (d *DryRunClient) ContainerCreate(ctx context.Context, config *containerType.Config, ...) (containerType.CreateResponse, error)
- func (d *DryRunClient) ContainerDiff(ctx context.Context, container string) ([]containerType.ContainerChangeResponseItem, error)
- func (d *DryRunClient) ContainerExecAttach(ctx context.Context, execID string, config moby.ExecStartCheck) (moby.HijackedResponse, error)
- func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config moby.ExecConfig) (moby.IDResponse, error)
- func (d *DryRunClient) ContainerExecInspect(ctx context.Context, execID string) (moby.ContainerExecInspect, error)
- func (d *DryRunClient) ContainerExecResize(ctx context.Context, execID string, options moby.ResizeOptions) error
- func (d *DryRunClient) ContainerExecStart(ctx context.Context, execID string, config moby.ExecStartCheck) error
- func (d *DryRunClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
- func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (moby.ContainerJSON, error)
- func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (moby.ContainerJSON, []byte, error)
- func (d *DryRunClient) ContainerKill(ctx context.Context, container, signal string) error
- func (d *DryRunClient) ContainerList(ctx context.Context, options moby.ContainerListOptions) ([]moby.Container, error)
- func (d *DryRunClient) ContainerLogs(ctx context.Context, container string, options moby.ContainerLogsOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ContainerPause(ctx context.Context, container string) error
- func (d *DryRunClient) ContainerRemove(ctx context.Context, container string, options moby.ContainerRemoveOptions) error
- func (d *DryRunClient) ContainerRename(ctx context.Context, container, newContainerName string) error
- func (d *DryRunClient) ContainerResize(ctx context.Context, container string, options moby.ResizeOptions) error
- func (d *DryRunClient) ContainerRestart(ctx context.Context, container string, options containerType.StopOptions) error
- func (d *DryRunClient) ContainerStart(ctx context.Context, container string, options moby.ContainerStartOptions) error
- func (d *DryRunClient) ContainerStatPath(ctx context.Context, container, path string) (moby.ContainerPathStat, error)
- func (d *DryRunClient) ContainerStats(ctx context.Context, container string, stream bool) (moby.ContainerStats, error)
- func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container string) (moby.ContainerStats, error)
- func (d *DryRunClient) ContainerStop(ctx context.Context, container string, options containerType.StopOptions) error
- func (d *DryRunClient) ContainerTop(ctx context.Context, container string, arguments []string) (containerType.ContainerTopOKBody, error)
- func (d *DryRunClient) ContainerUnpause(ctx context.Context, container string) error
- func (d *DryRunClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerType.UpdateConfig) (containerType.ContainerUpdateOKBody, error)
- func (d *DryRunClient) ContainerWait(ctx context.Context, container string, condition containerType.WaitCondition) (<-chan containerType.WaitResponse, <-chan error)
- func (d *DryRunClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (moby.ContainersPruneReport, error)
- func (d *DryRunClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, moby.ContainerPathStat, error)
- func (d *DryRunClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, ...) error
- func (d *DryRunClient) DaemonHost() string
- func (d *DryRunClient) DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
- func (d *DryRunClient) Dialer() func(context.Context) (net.Conn, error)
- func (d *DryRunClient) DiskUsage(ctx context.Context, options moby.DiskUsageOptions) (moby.DiskUsage, error)
- func (d *DryRunClient) DistributionInspect(ctx context.Context, imageName, encodedRegistryAuth string) (registry.DistributionInspect, error)
- func (d *DryRunClient) Events(ctx context.Context, options moby.EventsOptions) (<-chan events.Message, <-chan error)
- func (d *DryRunClient) HTTPClient() *http.Client
- func (d *DryRunClient) ImageBuild(ctx context.Context, reader io.Reader, options moby.ImageBuildOptions) (moby.ImageBuildResponse, error)
- func (d *DryRunClient) ImageCreate(ctx context.Context, parentReference string, options moby.ImageCreateOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string) ([]image.HistoryResponseItem, error)
- func (d *DryRunClient) ImageImport(ctx context.Context, source moby.ImageImportSource, ref string, ...) (io.ReadCloser, error)
- func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (moby.ImageInspect, []byte, error)
- func (d *DryRunClient) ImageList(ctx context.Context, options moby.ImageListOptions) ([]moby.ImageSummary, error)
- func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (moby.ImageLoadResponse, error)
- func (d *DryRunClient) ImagePull(ctx context.Context, ref string, options moby.ImagePullOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImagePush(ctx context.Context, ref string, options moby.ImagePushOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options moby.ImageRemoveOptions) ([]moby.ImageDeleteResponseItem, error)
- func (d *DryRunClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
- func (d *DryRunClient) ImageSearch(ctx context.Context, term string, options moby.ImageSearchOptions) ([]registry.SearchResult, error)
- func (d *DryRunClient) ImageTag(ctx context.Context, imageName, ref string) error
- func (d *DryRunClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (moby.ImagesPruneReport, error)
- func (d *DryRunClient) Info(ctx context.Context) (moby.Info, error)
- func (d *DryRunClient) NegotiateAPIVersion(ctx context.Context)
- func (d *DryRunClient) NegotiateAPIVersionPing(ping moby.Ping)
- func (d *DryRunClient) NetworkConnect(ctx context.Context, networkName, container string, ...) error
- func (d *DryRunClient) NetworkCreate(ctx context.Context, name string, options moby.NetworkCreate) (moby.NetworkCreateResponse, error)
- func (d *DryRunClient) NetworkDisconnect(ctx context.Context, networkName, container string, force bool) error
- func (d *DryRunClient) NetworkInspect(ctx context.Context, networkName string, options moby.NetworkInspectOptions) (moby.NetworkResource, error)
- func (d *DryRunClient) NetworkInspectWithRaw(ctx context.Context, networkName string, options moby.NetworkInspectOptions) (moby.NetworkResource, []byte, error)
- func (d *DryRunClient) NetworkList(ctx context.Context, options moby.NetworkListOptions) ([]moby.NetworkResource, error)
- func (d *DryRunClient) NetworkRemove(ctx context.Context, networkName string) error
- func (d *DryRunClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (moby.NetworksPruneReport, error)
- func (d *DryRunClient) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error)
- func (d *DryRunClient) NodeList(ctx context.Context, options moby.NodeListOptions) ([]swarm.Node, error)
- func (d *DryRunClient) NodeRemove(ctx context.Context, nodeID string, options moby.NodeRemoveOptions) error
- func (d *DryRunClient) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error
- func (d *DryRunClient) Ping(ctx context.Context) (moby.Ping, error)
- func (d *DryRunClient) PluginCreate(ctx context.Context, createContext io.Reader, options moby.PluginCreateOptions) error
- func (d *DryRunClient) PluginDisable(ctx context.Context, name string, options moby.PluginDisableOptions) error
- func (d *DryRunClient) PluginEnable(ctx context.Context, name string, options moby.PluginEnableOptions) error
- func (d *DryRunClient) PluginInspectWithRaw(ctx context.Context, name string) (*moby.Plugin, []byte, error)
- func (d *DryRunClient) PluginInstall(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
- func (d *DryRunClient) PluginList(ctx context.Context, filter filters.Args) (moby.PluginsListResponse, error)
- func (d *DryRunClient) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)
- func (d *DryRunClient) PluginRemove(ctx context.Context, name string, options moby.PluginRemoveOptions) error
- func (d *DryRunClient) PluginSet(ctx context.Context, name string, args []string) error
- func (d *DryRunClient) PluginUpgrade(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
- func (d *DryRunClient) RegistryLogin(ctx context.Context, auth moby.AuthConfig) (registry.AuthenticateOKBody, error)
- func (d *DryRunClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (moby.SecretCreateResponse, error)
- func (d *DryRunClient) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error)
- func (d *DryRunClient) SecretList(ctx context.Context, options moby.SecretListOptions) ([]swarm.Secret, error)
- func (d *DryRunClient) SecretRemove(ctx context.Context, id string) error
- func (d *DryRunClient) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error
- func (d *DryRunClient) ServerVersion(ctx context.Context) (moby.Version, error)
- func (d *DryRunClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, ...) (moby.ServiceCreateResponse, error)
- func (d *DryRunClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options moby.ServiceInspectOptions) (swarm.Service, []byte, error)
- func (d *DryRunClient) ServiceList(ctx context.Context, options moby.ServiceListOptions) ([]swarm.Service, error)
- func (d *DryRunClient) ServiceLogs(ctx context.Context, serviceID string, options moby.ContainerLogsOptions) (io.ReadCloser, error)
- func (d *DryRunClient) ServiceRemove(ctx context.Context, serviceID string) error
- func (d *DryRunClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, ...) (moby.ServiceUpdateResponse, error)
- func (d *DryRunClient) SwarmGetUnlockKey(ctx context.Context) (moby.SwarmUnlockKeyResponse, error)
- func (d *DryRunClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
- func (d *DryRunClient) SwarmInspect(ctx context.Context) (swarm.Swarm, error)
- func (d *DryRunClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error
- func (d *DryRunClient) SwarmLeave(ctx context.Context, force bool) error
- func (d *DryRunClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error
- func (d *DryRunClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarmSpec swarm.Spec, ...) error
- func (d *DryRunClient) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error)
- func (d *DryRunClient) TaskList(ctx context.Context, options moby.TaskListOptions) ([]swarm.Task, error)
- func (d *DryRunClient) TaskLogs(ctx context.Context, taskID string, options moby.ContainerLogsOptions) (io.ReadCloser, error)
- func (d *DryRunClient) VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)
- func (d *DryRunClient) VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error)
- func (d *DryRunClient) VolumeInspectWithRaw(ctx context.Context, volumeID string) (volume.Volume, []byte, error)
- func (d *DryRunClient) VolumeList(ctx context.Context, filter filters.Args) (volume.ListResponse, error)
- func (d *DryRunClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error
- func (d *DryRunClient) VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, ...) error
- func (d *DryRunClient) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (moby.VolumesPruneReport, error)
- type DryRunKey
- type Event
- type EventsOptions
- type ImageSummary
- type ImagesOptions
- type Interceptor
- type KillOptions
- type ListOptions
- type LogConsumer
- type LogOptions
- type PauseOptions
- type PortOptions
- type PortPublisher
- type PortPublishers
- type PsOptions
- type PullOptions
- type PushOptions
- type RemoveOptions
- type RestartOptions
- type RunOptions
- type Service
- type ServiceProxy
- func (s *ServiceProxy) Build(ctx context.Context, project *types.Project, options BuildOptions) error
- func (s *ServiceProxy) Config(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, error)
- func (s *ServiceProxy) Copy(ctx context.Context, projectName string, options CopyOptions) error
- func (s *ServiceProxy) Create(ctx context.Context, project *types.Project, options CreateOptions) error
- func (s *ServiceProxy) Down(ctx context.Context, project string, options DownOptions) error
- func (s *ServiceProxy) DryRunMode(ctx context.Context, dryRun bool) (context.Context, error)
- func (s *ServiceProxy) Events(ctx context.Context, projectName string, options EventsOptions) error
- func (s *ServiceProxy) Exec(ctx context.Context, projectName string, options RunOptions) (int, error)
- func (s *ServiceProxy) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error)
- func (s *ServiceProxy) Kill(ctx context.Context, projectName string, options KillOptions) error
- func (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack, error)
- func (s *ServiceProxy) Logs(ctx context.Context, projectName string, consumer LogConsumer, ...) error
- func (s *ServiceProxy) MaxConcurrency(i int)
- func (s *ServiceProxy) Pause(ctx context.Context, projectName string, options PauseOptions) error
- func (s *ServiceProxy) Port(ctx context.Context, projectName string, service string, port uint16, ...) (string, int, error)
- func (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error)
- func (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options PullOptions) error
- func (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options PushOptions) error
- func (s *ServiceProxy) Remove(ctx context.Context, projectName string, options RemoveOptions) error
- func (s *ServiceProxy) Restart(ctx context.Context, projectName string, options RestartOptions) error
- func (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error)
- func (s *ServiceProxy) Start(ctx context.Context, projectName string, options StartOptions) error
- func (s *ServiceProxy) Stop(ctx context.Context, projectName string, options StopOptions) error
- func (s *ServiceProxy) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error)
- func (s *ServiceProxy) UnPause(ctx context.Context, projectName string, options PauseOptions) error
- func (s *ServiceProxy) Up(ctx context.Context, project *types.Project, options UpOptions) error
- func (s *ServiceProxy) Watch(ctx context.Context, project *types.Project, services []string, ...) error
- func (s *ServiceProxy) WithInterceptor(interceptors ...Interceptor) *ServiceProxy
- func (s *ServiceProxy) WithService(service Service) *ServiceProxy
- type ServiceStatus
- type Stack
- type StartOptions
- type StopOptions
- type Streams
- type UpOptions
- type WatchOptions
Constants ¶
const ( // STARTING indicates that stack is being deployed STARTING string = "Starting" // RUNNING indicates that stack is deployed and services are running RUNNING string = "Running" // UPDATING indicates that some stack resources are being recreated UPDATING string = "Updating" // REMOVING indicates that stack is being deleted REMOVING string = "Removing" // UNKNOWN indicates unknown stack state UNKNOWN string = "Unknown" // FAILED indicates that stack deployment failed FAILED string = "Failed" )
const ( // RecreateDiverged to recreate services which configuration diverges from compose model RecreateDiverged = "diverged" // RecreateForce to force service container being recreated RecreateForce = "force" // RecreateNever to never recreate existing service containers RecreateNever = "never" )
const ( // ContainerEventLog is a ContainerEvent of type log on stdout. Line is set ContainerEventLog = iota // ContainerEventErr is a ContainerEvent of type log on stderr. Line is set ContainerEventErr // ContainerEventAttach is a ContainerEvent of type attach. First event sent about a container ContainerEventAttach // ContainerEventStopped is a ContainerEvent of type stopped. ContainerEventStopped // ContainerEventRecreated let consumer know container stopped but his being replaced ContainerEventRecreated // ContainerEventExit is a ContainerEvent of type exit. ExitCode is set ContainerEventExit // UserCancel user cancelled compose up, we are stopping containers UserCancel )
const ( // ProjectLabel allow to track resource related to a compose project ProjectLabel = "com.docker.compose.project" // ServiceLabel allow to track resource related to a compose service ServiceLabel = "com.docker.compose.service" // ConfigHashLabel stores configuration hash for a compose service ConfigHashLabel = "com.docker.compose.config-hash" // ContainerNumberLabel stores the container index of a replicated service ContainerNumberLabel = "com.docker.compose.container-number" // VolumeLabel allow to track resource related to a compose volume VolumeLabel = "com.docker.compose.volume" // NetworkLabel allow to track resource related to a compose network NetworkLabel = "com.docker.compose.network" // WorkingDirLabel stores absolute path to compose project working directory WorkingDirLabel = "com.docker.compose.project.working_dir" // ConfigFilesLabel stores absolute path to compose project configuration files ConfigFilesLabel = "com.docker.compose.project.config_files" // EnvironmentFileLabel stores absolute path to compose project env file set by `--env-file` EnvironmentFileLabel = "com.docker.compose.project.environment_file" // OneoffLabel stores value 'True' for one-off containers created by `compose run` OneoffLabel = "com.docker.compose.oneoff" // SlugLabel stores unique slug used for one-off container identity SlugLabel = "com.docker.compose.slug" // ImageDigestLabel stores digest of the container image used to run service ImageDigestLabel = "com.docker.compose.image" // DependenciesLabel stores service dependencies DependenciesLabel = "com.docker.compose.depends_on" // VersionLabel stores the compose tool version used to build/run application VersionLabel = "com.docker.compose.version" // ImageBuilderLabel stores the builder (classic or BuildKit) used to produce the image. ImageBuilderLabel = "com.docker.compose.image.builder" // ContainerReplaceLabel is set when container is created to replace another container (recreated) ContainerReplaceLabel = "com.docker.compose.replace" )
const (
DRYRUN_PREFIX = " DRY-RUN MODE - "
)
const ( // ExitCodeLoginRequired exit code when command cannot execute because it requires cloud login // This will be used by VSCode to detect when creating context if the user needs to login first ExitCodeLoginRequired = 5 )
Variables ¶
var ( // ErrNotFound is returned when an object is not found ErrNotFound = errors.New("not found") // ErrAlreadyExists is returned when an object already exists ErrAlreadyExists = errors.New("already exists") // ErrForbidden is returned when an operation is not permitted ErrForbidden = errors.New("forbidden") // ErrUnknown is returned when the error type is unmapped ErrUnknown = errors.New("unknown") // ErrLoginFailed is returned when login failed ErrLoginFailed = errors.New("login failed") // ErrLoginRequired is returned when login is required for a specific action ErrLoginRequired = errors.New("login required") // ErrNotImplemented is returned when a backend doesn't implement // an action ErrNotImplemented = errors.New("not implemented") // ErrUnsupportedFlag is returned when a backend doesn't support a flag ErrUnsupportedFlag = errors.New("unsupported flag") // ErrCanceled is returned when the command was canceled by user ErrCanceled = errors.New("canceled") // ErrParsingFailed is returned when a string cannot be parsed ErrParsingFailed = errors.New("parsing failed") // ErrWrongContextType is returned when the caller tries to get a context // with the wrong type ErrWrongContextType = errors.New("wrong context type") )
var ComposeVersion string
ComposeVersion is the compose tool version as declared by label VersionLabel
var Separator = "-"
Separator is used for naming components
Functions ¶
func GetImageNameOrDefault ¶
func GetImageNameOrDefault(service types.ServiceConfig, projectName string) string
GetImageNameOrDefault computes the default image name for a service, used to tag built images
func IsAlreadyExistsError ¶
IsAlreadyExistsError returns true if the unwrapped error is ErrAlreadyExists
func IsErrCanceled ¶
IsErrCanceled returns true if the unwrapped error is ErrCanceled
func IsErrNotImplemented ¶
IsErrNotImplemented returns true if the unwrapped error is ErrNotImplemented
func IsErrParsingFailed ¶
IsErrParsingFailed returns true if the unwrapped error is ErrParsingFailed
func IsErrUnsupportedFlag ¶
IsErrUnsupportedFlag returns true if the unwrapped error is ErrUnsupportedFlag
func IsForbiddenError ¶
IsForbiddenError returns true if the unwrapped error is ErrForbidden
func IsNotFoundError ¶
IsNotFoundError returns true if the unwrapped error is ErrNotFound
func IsUnknownError ¶
IsUnknownError returns true if the unwrapped error is ErrUnknown
Types ¶
type BuildOptions ¶
type BuildOptions struct { // Pull always attempt to pull a newer version of the image Pull bool // Push pushes service images Push bool // Progress set type of progress output ("auto", "plain", "tty") Progress string // Args set build-time args Args types.MappingWithEquals // NoCache disables cache use NoCache bool // Quiet make the build process not output to the console Quiet bool // Services passed in the command line to be built Services []string // Ssh authentications passed in the command line SSHs []types.SSHKey }
BuildOptions group options of the Build API
type ConfigOptions ¶
type ConfigOptions struct { // Format define the output format used to dump converted application model (json|yaml) Format string // Output defines the path to save the application model Output string // Resolve image reference to digests ResolveImageDigests bool }
ConfigOptions group options of the Config API
type ContainerEvent ¶
type ContainerEvent struct { Type int // Container is the name of the container _without the project prefix_. // // This is only suitable for display purposes within Compose, as it's // not guaranteed to be unique across services. Container string ID string Service string Line string // ContainerEventExit only ExitCode int Restarting bool }
ContainerEvent notify an event has been collected on source container implementing Service
type ContainerEventListener ¶
type ContainerEventListener func(event ContainerEvent)
ContainerEventListener is a callback to process ContainerEvent from services
type ContainerProcSummary ¶
ContainerProcSummary holds container processes top data
type ContainerSummary ¶
type ContainerSummary struct { ID string Name string Image any Command string Project string Service string Created int64 State string Status string Health string ExitCode int Publishers PortPublishers }
ContainerSummary hold high-level description of a container
type CopyOptions ¶
type CopyOptions struct { Source string Destination string All bool Index int FollowLink bool CopyUIDGID bool }
CopyOptions group options of the cp API
type CreateOptions ¶
type CreateOptions struct { // Services defines the services user interacts with Services []string // Remove legacy containers for services that are not defined in the project RemoveOrphans bool // Ignore legacy containers for services that are not defined in the project IgnoreOrphans bool // Recreate define the strategy to apply on existing containers Recreate string // RecreateDependencies define the strategy to apply on dependencies services RecreateDependencies string // Inherit reuse anonymous volumes from previous container Inherit bool // Timeout set delay to wait for container to gracelfuly stop before sending SIGKILL Timeout *time.Duration // QuietPull makes the pulling process quiet QuietPull bool }
CreateOptions group options of the Create API
type DownOptions ¶
type DownOptions struct { // RemoveOrphans will cleanup containers that are not declared on the compose model but own the same labels RemoveOrphans bool // Project is the compose project used to define this app. Might be nil if user ran `down` just with project name Project *types.Project // Timeout override container stop timeout Timeout *time.Duration // Images remove image used by services. 'all': Remove all images. 'local': Remove only images that don't have a tag Images string // Volumes remove volumes, both declared in the `volumes` section and anonymous ones Volumes bool }
DownOptions group options of the Down API
type DryRunClient ¶
type DryRunClient struct {
// contains filtered or unexported fields
}
DryRunClient implements APIClient by delegating to implementation functions. This allows lazy init and per-method overrides
func NewDryRunClient ¶
NewDryRunClient produces a DryRunClient
func (*DryRunClient) BuildCachePrune ¶
func (d *DryRunClient) BuildCachePrune(ctx context.Context, opts moby.BuildCachePruneOptions) (*moby.BuildCachePruneReport, error)
func (*DryRunClient) BuildCancel ¶
func (d *DryRunClient) BuildCancel(ctx context.Context, id string) error
func (*DryRunClient) CheckpointCreate ¶
func (d *DryRunClient) CheckpointCreate(ctx context.Context, container string, options moby.CheckpointCreateOptions) error
func (*DryRunClient) CheckpointDelete ¶
func (d *DryRunClient) CheckpointDelete(ctx context.Context, container string, options moby.CheckpointDeleteOptions) error
func (*DryRunClient) CheckpointList ¶
func (d *DryRunClient) CheckpointList(ctx context.Context, container string, options moby.CheckpointListOptions) ([]moby.Checkpoint, error)
func (*DryRunClient) ClientVersion ¶
func (d *DryRunClient) ClientVersion() string
func (*DryRunClient) Close ¶
func (d *DryRunClient) Close() error
func (*DryRunClient) ConfigCreate ¶
func (d *DryRunClient) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (moby.ConfigCreateResponse, error)
func (*DryRunClient) ConfigInspectWithRaw ¶
func (*DryRunClient) ConfigList ¶
func (d *DryRunClient) ConfigList(ctx context.Context, options moby.ConfigListOptions) ([]swarm.Config, error)
func (*DryRunClient) ConfigRemove ¶
func (d *DryRunClient) ConfigRemove(ctx context.Context, id string) error
func (*DryRunClient) ConfigUpdate ¶
func (d *DryRunClient) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error
func (*DryRunClient) ContainerAttach ¶
func (d *DryRunClient) ContainerAttach(ctx context.Context, container string, options moby.ContainerAttachOptions) (moby.HijackedResponse, error)
func (*DryRunClient) ContainerCommit ¶
func (d *DryRunClient) ContainerCommit(ctx context.Context, container string, options moby.ContainerCommitOptions) (moby.IDResponse, error)
func (*DryRunClient) ContainerCreate ¶
func (d *DryRunClient) ContainerCreate(ctx context.Context, config *containerType.Config, hostConfig *containerType.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (containerType.CreateResponse, error)
func (*DryRunClient) ContainerDiff ¶
func (d *DryRunClient) ContainerDiff(ctx context.Context, container string) ([]containerType.ContainerChangeResponseItem, error)
func (*DryRunClient) ContainerExecAttach ¶
func (d *DryRunClient) ContainerExecAttach(ctx context.Context, execID string, config moby.ExecStartCheck) (moby.HijackedResponse, error)
func (*DryRunClient) ContainerExecCreate ¶
func (d *DryRunClient) ContainerExecCreate(ctx context.Context, container string, config moby.ExecConfig) (moby.IDResponse, error)
func (*DryRunClient) ContainerExecInspect ¶
func (d *DryRunClient) ContainerExecInspect(ctx context.Context, execID string) (moby.ContainerExecInspect, error)
func (*DryRunClient) ContainerExecResize ¶
func (d *DryRunClient) ContainerExecResize(ctx context.Context, execID string, options moby.ResizeOptions) error
func (*DryRunClient) ContainerExecStart ¶
func (d *DryRunClient) ContainerExecStart(ctx context.Context, execID string, config moby.ExecStartCheck) error
func (*DryRunClient) ContainerExport ¶
func (d *DryRunClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
func (*DryRunClient) ContainerInspect ¶
func (d *DryRunClient) ContainerInspect(ctx context.Context, container string) (moby.ContainerJSON, error)
func (*DryRunClient) ContainerInspectWithRaw ¶
func (d *DryRunClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (moby.ContainerJSON, []byte, error)
func (*DryRunClient) ContainerKill ¶
func (d *DryRunClient) ContainerKill(ctx context.Context, container, signal string) error
func (*DryRunClient) ContainerList ¶
func (d *DryRunClient) ContainerList(ctx context.Context, options moby.ContainerListOptions) ([]moby.Container, error)
func (*DryRunClient) ContainerLogs ¶
func (d *DryRunClient) ContainerLogs(ctx context.Context, container string, options moby.ContainerLogsOptions) (io.ReadCloser, error)
func (*DryRunClient) ContainerPause ¶
func (d *DryRunClient) ContainerPause(ctx context.Context, container string) error
func (*DryRunClient) ContainerRemove ¶
func (d *DryRunClient) ContainerRemove(ctx context.Context, container string, options moby.ContainerRemoveOptions) error
func (*DryRunClient) ContainerRename ¶
func (d *DryRunClient) ContainerRename(ctx context.Context, container, newContainerName string) error
func (*DryRunClient) ContainerResize ¶
func (d *DryRunClient) ContainerResize(ctx context.Context, container string, options moby.ResizeOptions) error
func (*DryRunClient) ContainerRestart ¶
func (d *DryRunClient) ContainerRestart(ctx context.Context, container string, options containerType.StopOptions) error
func (*DryRunClient) ContainerStart ¶
func (d *DryRunClient) ContainerStart(ctx context.Context, container string, options moby.ContainerStartOptions) error
func (*DryRunClient) ContainerStatPath ¶
func (d *DryRunClient) ContainerStatPath(ctx context.Context, container, path string) (moby.ContainerPathStat, error)
func (*DryRunClient) ContainerStats ¶
func (d *DryRunClient) ContainerStats(ctx context.Context, container string, stream bool) (moby.ContainerStats, error)
func (*DryRunClient) ContainerStatsOneShot ¶
func (d *DryRunClient) ContainerStatsOneShot(ctx context.Context, container string) (moby.ContainerStats, error)
func (*DryRunClient) ContainerStop ¶
func (d *DryRunClient) ContainerStop(ctx context.Context, container string, options containerType.StopOptions) error
func (*DryRunClient) ContainerTop ¶
func (d *DryRunClient) ContainerTop(ctx context.Context, container string, arguments []string) (containerType.ContainerTopOKBody, error)
func (*DryRunClient) ContainerUnpause ¶
func (d *DryRunClient) ContainerUnpause(ctx context.Context, container string) error
func (*DryRunClient) ContainerUpdate ¶
func (d *DryRunClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerType.UpdateConfig) (containerType.ContainerUpdateOKBody, error)
func (*DryRunClient) ContainerWait ¶
func (d *DryRunClient) ContainerWait(ctx context.Context, container string, condition containerType.WaitCondition) (<-chan containerType.WaitResponse, <-chan error)
func (*DryRunClient) ContainersPrune ¶
func (d *DryRunClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (moby.ContainersPruneReport, error)
func (*DryRunClient) CopyFromContainer ¶
func (d *DryRunClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, moby.ContainerPathStat, error)
func (*DryRunClient) CopyToContainer ¶
func (d *DryRunClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options moby.CopyToContainerOptions) error
func (*DryRunClient) DaemonHost ¶
func (d *DryRunClient) DaemonHost() string
func (*DryRunClient) DialHijack ¶
func (*DryRunClient) DiskUsage ¶
func (d *DryRunClient) DiskUsage(ctx context.Context, options moby.DiskUsageOptions) (moby.DiskUsage, error)
func (*DryRunClient) DistributionInspect ¶
func (d *DryRunClient) DistributionInspect(ctx context.Context, imageName, encodedRegistryAuth string) (registry.DistributionInspect, error)
func (*DryRunClient) Events ¶
func (d *DryRunClient) Events(ctx context.Context, options moby.EventsOptions) (<-chan events.Message, <-chan error)
func (*DryRunClient) HTTPClient ¶
func (d *DryRunClient) HTTPClient() *http.Client
func (*DryRunClient) ImageBuild ¶
func (d *DryRunClient) ImageBuild(ctx context.Context, reader io.Reader, options moby.ImageBuildOptions) (moby.ImageBuildResponse, error)
func (*DryRunClient) ImageCreate ¶
func (d *DryRunClient) ImageCreate(ctx context.Context, parentReference string, options moby.ImageCreateOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageHistory ¶
func (d *DryRunClient) ImageHistory(ctx context.Context, imageName string) ([]image.HistoryResponseItem, error)
func (*DryRunClient) ImageImport ¶
func (d *DryRunClient) ImageImport(ctx context.Context, source moby.ImageImportSource, ref string, options moby.ImageImportOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageInspectWithRaw ¶
func (d *DryRunClient) ImageInspectWithRaw(ctx context.Context, imageName string) (moby.ImageInspect, []byte, error)
func (*DryRunClient) ImageList ¶
func (d *DryRunClient) ImageList(ctx context.Context, options moby.ImageListOptions) ([]moby.ImageSummary, error)
func (*DryRunClient) ImageLoad ¶
func (d *DryRunClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (moby.ImageLoadResponse, error)
func (*DryRunClient) ImagePull ¶
func (d *DryRunClient) ImagePull(ctx context.Context, ref string, options moby.ImagePullOptions) (io.ReadCloser, error)
func (*DryRunClient) ImagePush ¶
func (d *DryRunClient) ImagePush(ctx context.Context, ref string, options moby.ImagePushOptions) (io.ReadCloser, error)
func (*DryRunClient) ImageRemove ¶
func (d *DryRunClient) ImageRemove(ctx context.Context, imageName string, options moby.ImageRemoveOptions) ([]moby.ImageDeleteResponseItem, error)
func (*DryRunClient) ImageSave ¶
func (d *DryRunClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
func (*DryRunClient) ImageSearch ¶
func (d *DryRunClient) ImageSearch(ctx context.Context, term string, options moby.ImageSearchOptions) ([]registry.SearchResult, error)
func (*DryRunClient) ImageTag ¶
func (d *DryRunClient) ImageTag(ctx context.Context, imageName, ref string) error
func (*DryRunClient) ImagesPrune ¶
func (d *DryRunClient) ImagesPrune(ctx context.Context, pruneFilter filters.Args) (moby.ImagesPruneReport, error)
func (*DryRunClient) NegotiateAPIVersion ¶
func (d *DryRunClient) NegotiateAPIVersion(ctx context.Context)
func (*DryRunClient) NegotiateAPIVersionPing ¶
func (d *DryRunClient) NegotiateAPIVersionPing(ping moby.Ping)
func (*DryRunClient) NetworkConnect ¶
func (d *DryRunClient) NetworkConnect(ctx context.Context, networkName, container string, config *network.EndpointSettings) error
func (*DryRunClient) NetworkCreate ¶
func (d *DryRunClient) NetworkCreate(ctx context.Context, name string, options moby.NetworkCreate) (moby.NetworkCreateResponse, error)
func (*DryRunClient) NetworkDisconnect ¶
func (*DryRunClient) NetworkInspect ¶
func (d *DryRunClient) NetworkInspect(ctx context.Context, networkName string, options moby.NetworkInspectOptions) (moby.NetworkResource, error)
func (*DryRunClient) NetworkInspectWithRaw ¶
func (d *DryRunClient) NetworkInspectWithRaw(ctx context.Context, networkName string, options moby.NetworkInspectOptions) (moby.NetworkResource, []byte, error)
func (*DryRunClient) NetworkList ¶
func (d *DryRunClient) NetworkList(ctx context.Context, options moby.NetworkListOptions) ([]moby.NetworkResource, error)
func (*DryRunClient) NetworkRemove ¶
func (d *DryRunClient) NetworkRemove(ctx context.Context, networkName string) error
func (*DryRunClient) NetworksPrune ¶
func (d *DryRunClient) NetworksPrune(ctx context.Context, pruneFilter filters.Args) (moby.NetworksPruneReport, error)
func (*DryRunClient) NodeInspectWithRaw ¶
func (*DryRunClient) NodeList ¶
func (d *DryRunClient) NodeList(ctx context.Context, options moby.NodeListOptions) ([]swarm.Node, error)
func (*DryRunClient) NodeRemove ¶
func (d *DryRunClient) NodeRemove(ctx context.Context, nodeID string, options moby.NodeRemoveOptions) error
func (*DryRunClient) NodeUpdate ¶
func (*DryRunClient) PluginCreate ¶
func (d *DryRunClient) PluginCreate(ctx context.Context, createContext io.Reader, options moby.PluginCreateOptions) error
func (*DryRunClient) PluginDisable ¶
func (d *DryRunClient) PluginDisable(ctx context.Context, name string, options moby.PluginDisableOptions) error
func (*DryRunClient) PluginEnable ¶
func (d *DryRunClient) PluginEnable(ctx context.Context, name string, options moby.PluginEnableOptions) error
func (*DryRunClient) PluginInspectWithRaw ¶
func (*DryRunClient) PluginInstall ¶
func (d *DryRunClient) PluginInstall(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
func (*DryRunClient) PluginList ¶
func (d *DryRunClient) PluginList(ctx context.Context, filter filters.Args) (moby.PluginsListResponse, error)
func (*DryRunClient) PluginPush ¶
func (d *DryRunClient) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error)
func (*DryRunClient) PluginRemove ¶
func (d *DryRunClient) PluginRemove(ctx context.Context, name string, options moby.PluginRemoveOptions) error
func (*DryRunClient) PluginUpgrade ¶
func (d *DryRunClient) PluginUpgrade(ctx context.Context, name string, options moby.PluginInstallOptions) (io.ReadCloser, error)
func (*DryRunClient) RegistryLogin ¶
func (d *DryRunClient) RegistryLogin(ctx context.Context, auth moby.AuthConfig) (registry.AuthenticateOKBody, error)
func (*DryRunClient) SecretCreate ¶
func (d *DryRunClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (moby.SecretCreateResponse, error)
func (*DryRunClient) SecretInspectWithRaw ¶
func (*DryRunClient) SecretList ¶
func (d *DryRunClient) SecretList(ctx context.Context, options moby.SecretListOptions) ([]swarm.Secret, error)
func (*DryRunClient) SecretRemove ¶
func (d *DryRunClient) SecretRemove(ctx context.Context, id string) error
func (*DryRunClient) SecretUpdate ¶
func (d *DryRunClient) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error
func (*DryRunClient) ServerVersion ¶
func (*DryRunClient) ServiceCreate ¶
func (d *DryRunClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options moby.ServiceCreateOptions) (moby.ServiceCreateResponse, error)
func (*DryRunClient) ServiceInspectWithRaw ¶
func (d *DryRunClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options moby.ServiceInspectOptions) (swarm.Service, []byte, error)
func (*DryRunClient) ServiceList ¶
func (d *DryRunClient) ServiceList(ctx context.Context, options moby.ServiceListOptions) ([]swarm.Service, error)
func (*DryRunClient) ServiceLogs ¶
func (d *DryRunClient) ServiceLogs(ctx context.Context, serviceID string, options moby.ContainerLogsOptions) (io.ReadCloser, error)
func (*DryRunClient) ServiceRemove ¶
func (d *DryRunClient) ServiceRemove(ctx context.Context, serviceID string) error
func (*DryRunClient) ServiceUpdate ¶
func (d *DryRunClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options moby.ServiceUpdateOptions) (moby.ServiceUpdateResponse, error)
func (*DryRunClient) SwarmGetUnlockKey ¶
func (d *DryRunClient) SwarmGetUnlockKey(ctx context.Context) (moby.SwarmUnlockKeyResponse, error)
func (*DryRunClient) SwarmInit ¶
func (d *DryRunClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
func (*DryRunClient) SwarmInspect ¶
func (*DryRunClient) SwarmJoin ¶
func (d *DryRunClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error
func (*DryRunClient) SwarmLeave ¶
func (d *DryRunClient) SwarmLeave(ctx context.Context, force bool) error
func (*DryRunClient) SwarmUnlock ¶
func (d *DryRunClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error
func (*DryRunClient) SwarmUpdate ¶
func (d *DryRunClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarmSpec swarm.Spec, flags swarm.UpdateFlags) error
func (*DryRunClient) TaskInspectWithRaw ¶
func (*DryRunClient) TaskList ¶
func (d *DryRunClient) TaskList(ctx context.Context, options moby.TaskListOptions) ([]swarm.Task, error)
func (*DryRunClient) TaskLogs ¶
func (d *DryRunClient) TaskLogs(ctx context.Context, taskID string, options moby.ContainerLogsOptions) (io.ReadCloser, error)
func (*DryRunClient) VolumeCreate ¶
func (d *DryRunClient) VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)
func (*DryRunClient) VolumeInspect ¶
func (*DryRunClient) VolumeInspectWithRaw ¶
func (*DryRunClient) VolumeList ¶
func (d *DryRunClient) VolumeList(ctx context.Context, filter filters.Args) (volume.ListResponse, error)
func (*DryRunClient) VolumeRemove ¶
func (*DryRunClient) VolumeUpdate ¶
func (d *DryRunClient) VolumeUpdate(ctx context.Context, volumeID string, version swarm.Version, options volume.UpdateOptions) error
func (*DryRunClient) VolumesPrune ¶
func (d *DryRunClient) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (moby.VolumesPruneReport, error)
type Event ¶
type Event struct { Timestamp time.Time Service string Container string Status string Attributes map[string]string }
Event is a container runtime event served by Events API
type EventsOptions ¶
EventsOptions group options of the Events API
type ImageSummary ¶
ImageSummary holds container image description
type ImagesOptions ¶
type ImagesOptions struct {
Services []string
}
ImagesOptions group options of the Images API
type Interceptor ¶
Interceptor allow to customize the compose types.Project before the actual Service method is executed
type KillOptions ¶
type KillOptions struct { // RemoveOrphans will cleanup containers that are not declared on the compose model but own the same labels RemoveOrphans bool // Project is the compose project used to define this app. Might be nil if user ran command just with project name Project *types.Project // Services passed in the command line to be killed Services []string // Signal to send to containers Signal string }
KillOptions group options of the Kill API
type LogConsumer ¶
type LogConsumer interface { Log(containerName, message string) Err(containerName, message string) Status(container, msg string) Register(container string) }
LogConsumer is a callback to process log messages from services
type LogOptions ¶
type LogOptions struct { Project *types.Project Services []string Tail string Since string Until string Follow bool Timestamps bool }
LogOptions defines optional parameters for the `Log` API
type PauseOptions ¶
type PauseOptions struct { // Services passed in the command line to be started Services []string // Project is the compose project used to define this app. Might be nil if user ran command just with project name Project *types.Project }
PauseOptions group options of the Pause API
type PortOptions ¶
PortOptions group options of the Port API
type PortPublisher ¶
PortPublisher hold status about published port
type PortPublishers ¶
type PortPublishers []PortPublisher
PortPublishers is a slice of PortPublisher
func (PortPublishers) Less ¶
func (p PortPublishers) Less(i, j int) bool
Less implements sort.Interface
type PullOptions ¶
PullOptions group options of the Pull API
type PushOptions ¶
PushOptions group options of the Push API
type RemoveOptions ¶
type RemoveOptions struct { // Project is the compose project used to define this app. Might be nil if user ran command just with project name Project *types.Project // Stop option passed in the command line Stop bool // Volumes remove anonymous volumes Volumes bool // Force don't ask to confirm removal Force bool // Services passed in the command line to be removed Services []string }
RemoveOptions group options of the Remove API
type RestartOptions ¶
type RestartOptions struct { // Project is the compose project used to define this app. Might be nil if user ran command just with project name Project *types.Project // Timeout override container restart timeout Timeout *time.Duration // Services passed in the command line to be restarted Services []string }
RestartOptions group options of the Restart API
type RunOptions ¶
type RunOptions struct { // Project is the compose project used to define this app. Might be nil if user ran command just with project name Project *types.Project Name string Service string Command []string Entrypoint []string Detach bool AutoRemove bool Tty bool Interactive bool WorkingDir string User string Environment []string Labels types.Labels Privileged bool UseNetworkAliases bool NoDeps bool // QuietPull makes the pulling process quiet QuietPull bool // used by exec Index int }
RunOptions group options of the Run API
type Service ¶
type Service interface { // Build executes the equivalent to a `compose build` Build(ctx context.Context, project *types.Project, options BuildOptions) error // Push executes the equivalent to a `compose push` Push(ctx context.Context, project *types.Project, options PushOptions) error // Pull executes the equivalent of a `compose pull` Pull(ctx context.Context, project *types.Project, options PullOptions) error // Create executes the equivalent to a `compose create` Create(ctx context.Context, project *types.Project, options CreateOptions) error // Start executes the equivalent to a `compose start` Start(ctx context.Context, projectName string, options StartOptions) error // Restart restarts containers Restart(ctx context.Context, projectName string, options RestartOptions) error // Stop executes the equivalent to a `compose stop` Stop(ctx context.Context, projectName string, options StopOptions) error // Up executes the equivalent to a `compose up` Up(ctx context.Context, project *types.Project, options UpOptions) error // Down executes the equivalent to a `compose down` Down(ctx context.Context, projectName string, options DownOptions) error // Logs executes the equivalent to a `compose logs` Logs(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error // Ps executes the equivalent to a `compose ps` Ps(ctx context.Context, projectName string, options PsOptions) ([]ContainerSummary, error) // List executes the equivalent to a `docker stack ls` List(ctx context.Context, options ListOptions) ([]Stack, error) // Convert translate compose model into backend's native format Config(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, error) // Kill executes the equivalent to a `compose kill` Kill(ctx context.Context, projectName string, options KillOptions) error // RunOneOffContainer creates a service oneoff container and starts its dependencies RunOneOffContainer(ctx context.Context, project *types.Project, opts RunOptions) (int, error) // Remove executes the equivalent to a `compose rm` Remove(ctx context.Context, projectName string, options RemoveOptions) error // Exec executes a command in a running service container Exec(ctx context.Context, projectName string, options RunOptions) (int, error) // Copy copies a file/folder between a service container and the local filesystem Copy(ctx context.Context, projectName string, options CopyOptions) error // Pause executes the equivalent to a `compose pause` Pause(ctx context.Context, projectName string, options PauseOptions) error // UnPause executes the equivalent to a `compose unpause` UnPause(ctx context.Context, projectName string, options PauseOptions) error // Top executes the equivalent to a `compose top` Top(ctx context.Context, projectName string, services []string) ([]ContainerProcSummary, error) // Events executes the equivalent to a `compose events` Events(ctx context.Context, projectName string, options EventsOptions) error // Port executes the equivalent to a `compose port` Port(ctx context.Context, projectName string, service string, port uint16, options PortOptions) (string, int, error) // Images executes the equivalent of a `compose images` Images(ctx context.Context, projectName string, options ImagesOptions) ([]ImageSummary, error) // MaxConcurrency defines upper limit for concurrent operations against engine API MaxConcurrency(parallel int) // DryRunMode defines if dry run applies to the command DryRunMode(ctx context.Context, dryRun bool) (context.Context, error) // Watch services' development context and sync/notify/rebuild/restart on changes Watch(ctx context.Context, project *types.Project, services []string, options WatchOptions) error }
Service manages a compose project
type ServiceProxy ¶
type ServiceProxy struct { BuildFn func(ctx context.Context, project *types.Project, options BuildOptions) error PushFn func(ctx context.Context, project *types.Project, options PushOptions) error PullFn func(ctx context.Context, project *types.Project, opts PullOptions) error CreateFn func(ctx context.Context, project *types.Project, opts CreateOptions) error StartFn func(ctx context.Context, projectName string, options StartOptions) error RestartFn func(ctx context.Context, projectName string, options RestartOptions) error StopFn func(ctx context.Context, projectName string, options StopOptions) error UpFn func(ctx context.Context, project *types.Project, options UpOptions) error DownFn func(ctx context.Context, projectName string, options DownOptions) error LogsFn func(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error PsFn func(ctx context.Context, projectName string, options PsOptions) ([]ContainerSummary, error) ListFn func(ctx context.Context, options ListOptions) ([]Stack, error) ConfigFn func(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, error) KillFn func(ctx context.Context, project string, options KillOptions) error RunOneOffContainerFn func(ctx context.Context, project *types.Project, opts RunOptions) (int, error) RemoveFn func(ctx context.Context, project string, options RemoveOptions) error ExecFn func(ctx context.Context, project string, opts RunOptions) (int, error) CopyFn func(ctx context.Context, project string, options CopyOptions) error PauseFn func(ctx context.Context, project string, options PauseOptions) error UnPauseFn func(ctx context.Context, project string, options PauseOptions) error TopFn func(ctx context.Context, projectName string, services []string) ([]ContainerProcSummary, error) EventsFn func(ctx context.Context, project string, options EventsOptions) error PortFn func(ctx context.Context, project string, service string, port uint16, options PortOptions) (string, int, error) ImagesFn func(ctx context.Context, projectName string, options ImagesOptions) ([]ImageSummary, error) WatchFn func(ctx context.Context, project *types.Project, services []string, options WatchOptions) error MaxConcurrencyFn func(parallel int) DryRunModeFn func(ctx context.Context, dryRun bool) (context.Context, error) // contains filtered or unexported fields }
ServiceProxy implements Service by delegating to implementation functions. This allows lazy init and per-method overrides
func (*ServiceProxy) Build ¶
func (s *ServiceProxy) Build(ctx context.Context, project *types.Project, options BuildOptions) error
Build implements Service interface
func (*ServiceProxy) Config ¶
func (s *ServiceProxy) Config(ctx context.Context, project *types.Project, options ConfigOptions) ([]byte, error)
Convert implements Service interface
func (*ServiceProxy) Copy ¶
func (s *ServiceProxy) Copy(ctx context.Context, projectName string, options CopyOptions) error
Copy implements Service interface
func (*ServiceProxy) Create ¶
func (s *ServiceProxy) Create(ctx context.Context, project *types.Project, options CreateOptions) error
Create implements Service interface
func (*ServiceProxy) Down ¶
func (s *ServiceProxy) Down(ctx context.Context, project string, options DownOptions) error
Down implements Service interface
func (*ServiceProxy) DryRunMode ¶
func (*ServiceProxy) Events ¶
func (s *ServiceProxy) Events(ctx context.Context, projectName string, options EventsOptions) error
Events implements Service interface
func (*ServiceProxy) Exec ¶
func (s *ServiceProxy) Exec(ctx context.Context, projectName string, options RunOptions) (int, error)
Exec implements Service interface
func (*ServiceProxy) Images ¶
func (s *ServiceProxy) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error)
Images implements Service interface
func (*ServiceProxy) Kill ¶
func (s *ServiceProxy) Kill(ctx context.Context, projectName string, options KillOptions) error
Kill implements Service interface
func (*ServiceProxy) List ¶
func (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack, error)
List implements Service interface
func (*ServiceProxy) Logs ¶
func (s *ServiceProxy) Logs(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error
Logs implements Service interface
func (*ServiceProxy) MaxConcurrency ¶
func (s *ServiceProxy) MaxConcurrency(i int)
func (*ServiceProxy) Pause ¶
func (s *ServiceProxy) Pause(ctx context.Context, projectName string, options PauseOptions) error
Pause implements Service interface
func (*ServiceProxy) Port ¶
func (s *ServiceProxy) Port(ctx context.Context, projectName string, service string, port uint16, options PortOptions) (string, int, error)
Port implements Service interface
func (*ServiceProxy) Ps ¶
func (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error)
Ps implements Service interface
func (*ServiceProxy) Pull ¶
func (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options PullOptions) error
Pull implements Service interface
func (*ServiceProxy) Push ¶
func (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options PushOptions) error
Push implements Service interface
func (*ServiceProxy) Remove ¶
func (s *ServiceProxy) Remove(ctx context.Context, projectName string, options RemoveOptions) error
Remove implements Service interface
func (*ServiceProxy) Restart ¶
func (s *ServiceProxy) Restart(ctx context.Context, projectName string, options RestartOptions) error
Restart implements Service interface
func (*ServiceProxy) RunOneOffContainer ¶
func (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error)
RunOneOffContainer implements Service interface
func (*ServiceProxy) Start ¶
func (s *ServiceProxy) Start(ctx context.Context, projectName string, options StartOptions) error
Start implements Service interface
func (*ServiceProxy) Stop ¶
func (s *ServiceProxy) Stop(ctx context.Context, projectName string, options StopOptions) error
Stop implements Service interface
func (*ServiceProxy) Top ¶
func (s *ServiceProxy) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error)
Top implements Service interface
func (*ServiceProxy) UnPause ¶
func (s *ServiceProxy) UnPause(ctx context.Context, projectName string, options PauseOptions) error
UnPause implements Service interface
func (*ServiceProxy) Watch ¶
func (s *ServiceProxy) Watch(ctx context.Context, project *types.Project, services []string, options WatchOptions) error
Watch implements Service interface
func (*ServiceProxy) WithInterceptor ¶
func (s *ServiceProxy) WithInterceptor(interceptors ...Interceptor) *ServiceProxy
WithInterceptor configures Interceptor to be applied to Service method execution
func (*ServiceProxy) WithService ¶
func (s *ServiceProxy) WithService(service Service) *ServiceProxy
WithService configure proxy to use specified Service as delegate
type ServiceStatus ¶
type ServiceStatus struct { ID string Name string Replicas int Desired int Ports []string Publishers []PortPublisher }
ServiceStatus hold status about a service
type StartOptions ¶
type StartOptions struct { // Project is the compose project used to define this app. Might be nil if user ran command just with project name Project *types.Project // Attach to container and forward logs if not nil Attach LogConsumer // AttachTo set the services to attach to AttachTo []string // CascadeStop stops the application when a container stops CascadeStop bool // ExitCodeFrom return exit code from specified service ExitCodeFrom string // Wait won't return until containers reached the running|healthy state Wait bool WaitTimeout time.Duration // Services passed in the command line to be started Services []string }
StartOptions group options of the Start API
type StopOptions ¶
type StopOptions struct { // Project is the compose project used to define this app. Might be nil if user ran command just with project name Project *types.Project // Timeout override container stop timeout Timeout *time.Duration // Services passed in the command line to be stopped Services []string }
StopOptions group options of the Stop API
type UpOptions ¶
type UpOptions struct { Create CreateOptions Start StartOptions }
UpOptions group options of the Up API