{"modulePath":"github.com/docker/compose-cli","version":"v1.0.17","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package compose\n\n## Constants\n\n```go\nconst (\n\t// STARTING indicates that stack is being deployed\n\tSTARTING string = \"Starting\"\n\t// RUNNING indicates that stack is deployed and services are running\n\tRUNNING string = \"Running\"\n\t// UPDATING indicates that some stack resources are being recreated\n\tUPDATING string = \"Updating\"\n\t// REMOVING indicates that stack is being deleted\n\tREMOVING string = \"Removing\"\n\t// UNKNOWN indicates unknown stack state\n\tUNKNOWN string = \"Unknown\"\n\t// FAILED indicates that stack deployment failed\n\tFAILED string = \"Failed\"\n)\n```\n\n```go\nconst (\n\t// RecreateDiverged to recreate services which configuration diverges from compose model\n\tRecreateDiverged = \"diverged\"\n\t// RecreateForce to force service container being recreated\n\tRecreateForce = \"force\"\n\t// RecreateNever to never recreate existing service containers\n\tRecreateNever = \"never\"\n)\n```\n\n```go\nconst (\n\t// ContainerEventLog is a ContainerEvent of type log. Line is set\n\tContainerEventLog = iota\n\t// ContainerEventAttach is a ContainerEvent of type attach. First event sent about a container\n\tContainerEventAttach\n\t// ContainerEventExit is a ContainerEvent of type exit. ExitCode is set\n\tContainerEventExit\n\t// UserCancel user cancelled compose up, we are stopping containers\n\tUserCancel\n)\n```\n\n```go\nconst (\n\t// ProjectTag allow to track resource related to a compose project\n\tProjectTag = \"com.docker.compose.project\"\n\t// NetworkTag allow to track resource related to a compose network\n\tNetworkTag = \"com.docker.compose.network\"\n\t// ServiceTag allow to track resource related to a compose service\n\tServiceTag = \"com.docker.compose.service\"\n\t// VolumeTag allow to track resource related to a compose volume\n\tVolumeTag = \"com.docker.compose.volume\"\n\t// EnvironmentFileLabel is set in containers with the option \"--env-file\" when set\n\tEnvironmentFileLabel = \"com.docker.compose.project.environment_file\"\n)\n```\n\n## Types\n\n```go\ntype BuildOptions struct {\n\t// Pull always attempt to pull a newer version of the image\n\tPull bool\n\t// Progress set type of progress output (\"auto\", \"plain\", \"tty\")\n\tProgress string\n\t// Args set build-time args\n\tArgs types.MappingWithEquals\n\t// NoCache disables cache use\n\tNoCache bool\n\t// Quiet make the build process not output to the console\n\tQuiet bool\n}\n```\nBuildOptions group options of the Build API\n\n```go\ntype ContainerEvent struct {\n\tType      int\n\tContainer string\n\tService   string\n\tLine      string\n\t// ContainerEventExit only\n\tExitCode   int\n\tRestarting bool\n}\n```\nContainerEvent notify an event has been collected on source container implementing Service\n\n```go\ntype ContainerEventListener func(event ContainerEvent)\n```\nContainerEventListener is a callback to process ContainerEvent from services\n\n```go\ntype ContainerProcSummary struct {\n\tID        string\n\tName      string\n\tProcesses [][]string\n\tTitles    []string\n}\n```\nContainerProcSummary holds container processes top data\n\n```go\ntype ContainerSummary struct {\n\tID         string\n\tName       string\n\tProject    string\n\tService    string\n\tState      string\n\tHealth     string\n\tExitCode   int\n\tPublishers []PortPublisher\n}\n```\nContainerSummary hold high-level description of a container\n\n```go\ntype ConvertOptions struct {\n\t// Format define the output format used to dump converted application model (json|yaml)\n\tFormat string\n\t// Output defines the path to save the application model\n\tOutput string\n}\n```\nConvertOptions group options of the Convert API\n\n```go\ntype CopyOptions struct {\n\tSource      string\n\tDestination string\n\tAll         bool\n\tIndex       int\n\tFollowLink  bool\n\tCopyUIDGID  bool\n}\n```\nCopyOptions group options of the cp API\n\n```go\ntype CreateOptions struct {\n\t// Services defines the services user interacts with\n\tServices []string\n\t// Remove legacy containers for services that are not defined in the project\n\tRemoveOrphans bool\n\t// Recreate define the strategy to apply on existing containers\n\tRecreate string\n\t// RecreateDependencies define the strategy to apply on dependencies services\n\tRecreateDependencies string\n\t// Inherit reuse anonymous volumes from previous container\n\tInherit bool\n\t// Timeout set delay to wait for container to gracelfuly stop before sending SIGKILL\n\tTimeout *time.Duration\n\t// QuietPull makes the pulling process quiet\n\tQuietPull bool\n}\n```\nCreateOptions group options of the Create API\n\n```go\ntype DownOptions struct {\n\t// RemoveOrphans will cleanup containers that are not declared on the compose model but own the same labels\n\tRemoveOrphans bool\n\t// Project is the compose project used to define this app. Might be nil if user ran `down` just with project name\n\tProject *types.Project\n\t// Timeout override container stop timeout\n\tTimeout *time.Duration\n\t// Images remove image used by services. 'all': Remove all images. 'local': Remove only images that don't have a tag\n\tImages string\n\t// Volumes remove volumes, both declared in the `volumes` section and anonymous ones\n\tVolumes bool\n}\n```\nDownOptions group options of the Down API\n\n```go\ntype Event struct {\n\tTimestamp  time.Time\n\tService    string\n\tContainer  string\n\tStatus     string\n\tAttributes map[string]string\n}\n```\nEvent is a container runtime event served by Events API\n\n```go\nfunc (e Event) String() string\n```\n\n```go\ntype EventsOptions struct {\n\tServices []string\n\tConsumer func(event Event) error\n}\n```\nEventsOptions group options of the Events API\n\n```go\ntype ImageSummary struct {\n\tID            string\n\tContainerName string\n\tRepository    string\n\tTag           string\n\tSize          int64\n}\n```\nImageSummary holds container image description\n\n```go\ntype ImagesOptions struct {\n\tServices []string\n}\n```\nImagesOptions group options of the Images API\n\n```go\ntype Interceptor func(ctx context.Context, project *types.Project)\n```\nInterceptor allow to customize the compose types.Project before the actual Service method is executed\n\n```go\ntype KillOptions struct {\n\t// Signal to send to containers\n\tSignal string\n}\n```\nKillOptions group options of the Kill API\n\n```go\ntype ListOptions struct {\n\tAll bool\n}\n```\nListOptions group options of the ls API\n\n```go\ntype LogConsumer interface {\n\tLog(service, container, message string)\n\tStatus(container, msg string)\n\tRegister(container string)\n}\n```\nLogConsumer is a callback to process log messages from services\n\n```go\ntype LogOptions struct {\n\tServices   []string\n\tTail       string\n\tFollow     bool\n\tTimestamps bool\n}\n```\nLogOptions defines optional parameters for the \\`Log\\` API\n\n```go\ntype LogPrinter interface {\n\tHandleEvent(event ContainerEvent)\n\tRun(cascadeStop bool, exitCodeFrom string, stopFn func() error) (int, error)\n\tCancel()\n}\n```\nLogPrinter watch application containers an collect their logs\n\n```go\nfunc NewLogPrinter(consumer LogConsumer) LogPrinter\n```\nNewLogPrinter builds a LogPrinter passing containers logs to LogConsumer\n\n```go\ntype PauseOptions struct {\n\t// Services passed in the command line to be started\n\tServices []string\n}\n```\nPauseOptions group options of the Pause API\n\n```go\ntype PortOptions struct {\n\tProtocol string\n\tIndex    int\n}\n```\nPortOptions group options of the Port API\n\n```go\ntype PortPublisher struct {\n\tURL           string\n\tTargetPort    int\n\tPublishedPort int\n\tProtocol      string\n}\n```\nPortPublisher hold status about published port\n\n```go\ntype PsOptions struct {\n\tAll      bool\n\tServices []string\n}\n```\nPsOptions group options of the Ps API\n\n```go\ntype PullOptions struct {\n\tIgnoreFailures bool\n}\n```\nPullOptions group options of the Push API\n\n```go\ntype PushOptions struct {\n\tIgnoreFailures bool\n}\n```\nPushOptions group options of the Push API\n\n```go\ntype RemoveOptions struct {\n\t// DryRun just list removable resources\n\tDryRun bool\n\t// Volumes remove anonymous volumes\n\tVolumes bool\n\t// Force don't ask to confirm removal\n\tForce bool\n\t// Services passed in the command line to be removed\n\tServices []string\n}\n```\nRemoveOptions group options of the Remove API\n\n```go\ntype RestartOptions struct {\n\t// Timeout override container restart timeout\n\tTimeout *time.Duration\n\t// Services passed in the command line to be restarted\n\tServices []string\n}\n```\nRestartOptions group options of the Restart API\n\n```go\ntype RunOptions struct {\n\tName              string\n\tService           string\n\tCommand           []string\n\tEntrypoint        []string\n\tDetach            bool\n\tAutoRemove        bool\n\tWriter            io.WriteCloser\n\tReader            io.ReadCloser\n\tTty               bool\n\tWorkingDir        string\n\tUser              string\n\tEnvironment       []string\n\tLabels            types.Labels\n\tPrivileged        bool\n\tUseNetworkAliases bool\n\t// used by exec\n\tIndex int\n}\n```\nRunOptions group options of the Run API\n\n```go\ntype Service interface {\n\t// Build executes the equivalent to a `compose build`\n\tBuild(ctx context.Context, project *types.Project, options BuildOptions) error\n\t// Push executes the equivalent ot a `compose push`\n\tPush(ctx context.Context, project *types.Project, options PushOptions) error\n\t// Pull executes the equivalent of a `compose pull`\n\tPull(ctx context.Context, project *types.Project, opts PullOptions) error\n\t// Create executes the equivalent to a `compose create`\n\tCreate(ctx context.Context, project *types.Project, opts CreateOptions) error\n\t// Start executes the equivalent to a `compose start`\n\tStart(ctx context.Context, project *types.Project, options StartOptions) error\n\t// Restart restarts containers\n\tRestart(ctx context.Context, project *types.Project, options RestartOptions) error\n\t// Stop executes the equivalent to a `compose stop`\n\tStop(ctx context.Context, project *types.Project, options StopOptions) error\n\t// Up executes the equivalent to a `compose up`\n\tUp(ctx context.Context, project *types.Project, options UpOptions) error\n\t// Down executes the equivalent to a `compose down`\n\tDown(ctx context.Context, projectName string, options DownOptions) error\n\t// Logs executes the equivalent to a `compose logs`\n\tLogs(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error\n\t// Ps executes the equivalent to a `compose ps`\n\tPs(ctx context.Context, projectName string, options PsOptions) ([]ContainerSummary, error)\n\t// List executes the equivalent to a `docker stack ls`\n\tList(ctx context.Context, options ListOptions) ([]Stack, error)\n\t// Convert translate compose model into backend's native format\n\tConvert(ctx context.Context, project *types.Project, options ConvertOptions) ([]byte, error)\n\t// Kill executes the equivalent to a `compose kill`\n\tKill(ctx context.Context, project *types.Project, options KillOptions) error\n\t// RunOneOffContainer creates a service oneoff container and starts its dependencies\n\tRunOneOffContainer(ctx context.Context, project *types.Project, opts RunOptions) (int, error)\n\t// Remove executes the equivalent to a `compose rm`\n\tRemove(ctx context.Context, project *types.Project, options RemoveOptions) ([]string, error)\n\t// Exec executes a command in a running service container\n\tExec(ctx context.Context, project *types.Project, opts RunOptions) (int, error)\n\t// Copy copies a file/folder between a service container and the local filesystem\n\tCopy(ctx context.Context, project *types.Project, opts CopyOptions) error\n\t// Pause executes the equivalent to a `compose pause`\n\tPause(ctx context.Context, project string, options PauseOptions) error\n\t// UnPause executes the equivalent to a `compose unpause`\n\tUnPause(ctx context.Context, project string, options PauseOptions) error\n\t// Top executes the equivalent to a `compose top`\n\tTop(ctx context.Context, projectName string, services []string) ([]ContainerProcSummary, error)\n\t// Events executes the equivalent to a `compose events`\n\tEvents(ctx context.Context, project string, options EventsOptions) error\n\t// Port executes the equivalent to a `compose port`\n\tPort(ctx context.Context, project string, service string, port int, options PortOptions) (string, int, error)\n\t// Images executes the equivalent of a `compose images`\n\tImages(ctx context.Context, projectName string, options ImagesOptions) ([]ImageSummary, error)\n}\n```\nService manages a compose project\n\n```go\ntype ServiceProxy struct {\n\tBuildFn              func(ctx context.Context, project *types.Project, options BuildOptions) error\n\tPushFn               func(ctx context.Context, project *types.Project, options PushOptions) error\n\tPullFn               func(ctx context.Context, project *types.Project, opts PullOptions) error\n\tCreateFn             func(ctx context.Context, project *types.Project, opts CreateOptions) error\n\tStartFn              func(ctx context.Context, project *types.Project, options StartOptions) error\n\tRestartFn            func(ctx context.Context, project *types.Project, options RestartOptions) error\n\tStopFn               func(ctx context.Context, project *types.Project, options StopOptions) error\n\tUpFn                 func(ctx context.Context, project *types.Project, options UpOptions) error\n\tDownFn               func(ctx context.Context, projectName string, options DownOptions) error\n\tLogsFn               func(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error\n\tPsFn                 func(ctx context.Context, projectName string, options PsOptions) ([]ContainerSummary, error)\n\tListFn               func(ctx context.Context, options ListOptions) ([]Stack, error)\n\tConvertFn            func(ctx context.Context, project *types.Project, options ConvertOptions) ([]byte, error)\n\tKillFn               func(ctx context.Context, project *types.Project, options KillOptions) error\n\tRunOneOffContainerFn func(ctx context.Context, project *types.Project, opts RunOptions) (int, error)\n\tRemoveFn             func(ctx context.Context, project *types.Project, options RemoveOptions) ([]string, error)\n\tExecFn               func(ctx context.Context, project *types.Project, opts RunOptions) (int, error)\n\tCopyFn               func(ctx context.Context, project *types.Project, opts CopyOptions) error\n\tPauseFn              func(ctx context.Context, project string, options PauseOptions) error\n\tUnPauseFn            func(ctx context.Context, project string, options PauseOptions) error\n\tTopFn                func(ctx context.Context, projectName string, services []string) ([]ContainerProcSummary, error)\n\tEventsFn             func(ctx context.Context, project string, options EventsOptions) error\n\tPortFn               func(ctx context.Context, project string, service string, port int, options PortOptions) (string, int, error)\n\tImagesFn             func(ctx context.Context, projectName string, options ImagesOptions) ([]ImageSummary, error)\n\t// contains filtered or unexported fields\n}\n```\nServiceProxy implements Service by delegating to implementation functions. This allows lazy init and per-method overrides\n\n```go\nfunc NewServiceProxy() *ServiceProxy\n```\nNewServiceProxy produces a ServiceProxy\n\n```go\nfunc (s *ServiceProxy) Build(ctx context.Context, project *types.Project, options BuildOptions) error\n```\nBuild implements Service interface\n\n```go\nfunc (s *ServiceProxy) Convert(ctx context.Context, project *types.Project, options ConvertOptions) ([]byte, error)\n```\nConvert implements Service interface\n\n```go\nfunc (s *ServiceProxy) Copy(ctx context.Context, project *types.Project, options CopyOptions) error\n```\nCopy implements Service interface\n\n```go\nfunc (s *ServiceProxy) Create(ctx context.Context, project *types.Project, options CreateOptions) error\n```\nCreate implements Service interface\n\n```go\nfunc (s *ServiceProxy) Down(ctx context.Context, project string, options DownOptions) error\n```\nDown implements Service interface\n\n```go\nfunc (s *ServiceProxy) Events(ctx context.Context, project string, options EventsOptions) error\n```\nEvents implements Service interface\n\n```go\nfunc (s *ServiceProxy) Exec(ctx context.Context, project *types.Project, options RunOptions) (int, error)\n```\nExec implements Service interface\n\n```go\nfunc (s *ServiceProxy) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error)\n```\nImages implements Service interface\n\n```go\nfunc (s *ServiceProxy) Kill(ctx context.Context, project *types.Project, options KillOptions) error\n```\nKill implements Service interface\n\n```go\nfunc (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack, error)\n```\nList implements Service interface\n\n```go\nfunc (s *ServiceProxy) Logs(ctx context.Context, project string, consumer LogConsumer, options LogOptions) error\n```\nLogs implements Service interface\n\n```go\nfunc (s *ServiceProxy) Pause(ctx context.Context, project string, options PauseOptions) error\n```\nPause implements Service interface\n\n```go\nfunc (s *ServiceProxy) Port(ctx context.Context, project string, service string, port int, options PortOptions) (string, int, error)\n```\nPort implements Service interface\n\n```go\nfunc (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error)\n```\nPs implements Service interface\n\n```go\nfunc (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options PullOptions) error\n```\nPull implements Service interface\n\n```go\nfunc (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options PushOptions) error\n```\nPush implements Service interface\n\n```go\nfunc (s *ServiceProxy) Remove(ctx context.Context, project *types.Project, options RemoveOptions) ([]string, error)\n```\nRemove implements Service interface\n\n```go\nfunc (s *ServiceProxy) Restart(ctx context.Context, project *types.Project, options RestartOptions) error\n```\nRestart implements Service interface\n\n```go\nfunc (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error)\n```\nRunOneOffContainer implements Service interface\n\n```go\nfunc (s *ServiceProxy) Start(ctx context.Context, project *types.Project, options StartOptions) error\n```\nStart implements Service interface\n\n```go\nfunc (s *ServiceProxy) Stop(ctx context.Context, project *types.Project, options StopOptions) error\n```\nStop implements Service interface\n\n```go\nfunc (s *ServiceProxy) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error)\n```\nTop implements Service interface\n\n```go\nfunc (s *ServiceProxy) UnPause(ctx context.Context, project string, options PauseOptions) error\n```\nUnPause implements Service interface\n\n```go\nfunc (s *ServiceProxy) Up(ctx context.Context, project *types.Project, options UpOptions) error\n```\nUp implements Service interface\n\n```go\nfunc (s *ServiceProxy) WithInterceptor(interceptors ...Interceptor) *ServiceProxy\n```\nWithInterceptor configures Interceptor to be applied to Service method execution\n\n```go\nfunc (s *ServiceProxy) WithService(service Service) *ServiceProxy\n```\nWithService configure proxy to use specified Service as delegate\n\n```go\ntype ServiceStatus struct {\n\tID         string\n\tName       string\n\tReplicas   int\n\tDesired    int\n\tPorts      []string\n\tPublishers []PortPublisher\n}\n```\nServiceStatus hold status about a service\n\n```go\ntype Stack struct {\n\tID     string\n\tName   string\n\tStatus string\n\tReason string\n}\n```\nStack holds the name and state of a compose application/stack\n\n```go\ntype StartOptions struct {\n\t// Attach will attach to service containers and send container logs and events\n\tAttach ContainerEventListener\n\t// Services passed in the command line to be started\n\tServices []string\n}\n```\nStartOptions group options of the Start API\n\n```go\ntype StopOptions struct {\n\t// Timeout override container stop timeout\n\tTimeout *time.Duration\n\t// Services passed in the command line to be stopped\n\tServices []string\n}\n```\nStopOptions group options of the Stop API\n\n```go\ntype UpOptions struct {\n\t// Detach will create services and return immediately\n\tDetach bool\n\t// QuietPull makes the pulling process quiet\n\tQuietPull bool\n}\n```\nUpOptions group options of the Up API\n\n","path":"github.com/docker/compose-cli/api/compose","name":"compose","synopsis":"","isRedistributable":true}
