{"modulePath":"github.com/docker/compose-cli","version":"v1.0.7","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package progress\n\n## Functions\n\n```go\nfunc Run(ctx context.Context, pf progressFunc) (string, error)\n```\nRun will run a writer and the progress function in parallel\n\n```go\nfunc WithContextWriter(ctx context.Context, writer Writer) context.Context\n```\nWithContextWriter adds the writer to the context\n\n## Types\n\n```go\ntype Event struct {\n\tID         string\n\tParentID   string\n\tText       string\n\tStatus     EventStatus\n\tStatusText string\n\t// contains filtered or unexported fields\n}\n```\nEvent represents a progress event.\n\n```go\nfunc CreatedEvent(ID string) Event\n```\nCreatedEvent creates a new Created (done) Event\n\n```go\nfunc CreatingEvent(ID string) Event\n```\nCreatingEvent creates a new Create in progress Event\n\n```go\nfunc ErrorEvent(ID string) Event\n```\nErrorEvent creates a new Error Event\n\n```go\nfunc ErrorMessageEvent(ID string, msg string) Event\n```\nErrorMessageEvent creates a new Error Event with message\n\n```go\nfunc NewEvent(ID string, status EventStatus, statusText string) Event\n```\nNewEvent new event\n\n```go\nfunc RemovedEvent(ID string) Event\n```\nRemovedEvent creates a new removed (done) Event\n\n```go\nfunc RemovingEvent(ID string) Event\n```\nRemovingEvent creates a new Removing in progress Event\n\n```go\nfunc RunningEvent(ID string) Event\n```\nRunningEvent creates a new Running in progress Event\n\n```go\nfunc StartedEvent(ID string) Event\n```\nStartedEvent creates a new Started in progress Event\n\n```go\nfunc StartingEvent(ID string) Event\n```\nStartingEvent creates a new Starting in progress Event\n\n```go\nfunc StoppingEvent(ID string) Event\n```\nStoppingEvent stops a new Removing in progress Event\n\n```go\ntype EventStatus int\n```\nEventStatus indicates the status of an action\n\n```go\nconst (\n\t// Working means that the current task is working\n\tWorking EventStatus = iota\n\t// Done means that the current task is done\n\tDone\n\t// Error means that the current task has errored\n\tError\n)\n```\n\n```go\ntype Writer interface {\n\tStart(context.Context) error\n\tStop()\n\tEvent(Event)\n}\n```\nWriter can write multiple progress events\n\n```go\nfunc ContextWriter(ctx context.Context) Writer\n```\nContextWriter returns the writer from the context\n\n```go\nfunc NewWriter(out console.File) (Writer, error)\n```\nNewWriter returns a new multi-progress writer\n\n","path":"github.com/docker/compose-cli/progress","name":"progress","synopsis":"","isRedistributable":true}
