package progress
import "github.com/docker/compose/v2/pkg/progress"
Index ¶
- func Run(ctx context.Context, pf progressFunc) error
- func RunWithStatus(ctx context.Context, pf progressFuncWithStatus) (string, error)
- func WithContextWriter(ctx context.Context, writer Writer) context.Context
- type Event
- func CreatedEvent(ID string) Event
- func CreatingEvent(ID string) Event
- func ErrorEvent(ID string) Event
- func ErrorMessageEvent(ID string, msg string) Event
- func Exited(ID string) Event
- func Healthy(ID string) Event
- func KilledEvent(ID string) Event
- func KillingEvent(ID string) Event
- func NewEvent(ID string, status EventStatus, statusText string) Event
- func RemovedEvent(ID string) Event
- func RemovingEvent(ID string) Event
- func RestartedEvent(ID string) Event
- func RestartingEvent(ID string) Event
- func RunningEvent(ID string) Event
- func StartedEvent(ID string) Event
- func StartingEvent(ID string) Event
- func StoppedEvent(ID string) Event
- func StoppingEvent(ID string) Event
- func Waiting(ID string) Event
- type EventStatus
- type Writer
Functions ¶
func Run ¶
Run will run a writer and the progress function in parallel
func RunWithStatus ¶
RunWithStatus will run a writer and the progress function in parallel and return a status
func WithContextWriter ¶
WithContextWriter adds the writer to the context
Types ¶
type Event ¶
type Event struct { ID string ParentID string Text string Status EventStatus StatusText string // contains filtered or unexported fields }
Event represents a progress event.
func CreatedEvent ¶
CreatedEvent creates a new Created (done) Event
func CreatingEvent ¶
CreatingEvent creates a new Create in progress Event
func ErrorEvent ¶
ErrorEvent creates a new Error Event
func ErrorMessageEvent ¶
ErrorMessageEvent creates a new Error Event with message
func Exited ¶
Exited creates a new exited event
func Healthy ¶
Healthy creates a new healthy event
func KilledEvent ¶
KilledEvent creates a new Killed in progress Event
func KillingEvent ¶
KillingEvent creates a new Killing in progress Event
func NewEvent ¶
func NewEvent(ID string, status EventStatus, statusText string) Event
NewEvent new event
func RemovedEvent ¶
RemovedEvent creates a new removed (done) Event
func RemovingEvent ¶
RemovingEvent creates a new Removing in progress Event
func RestartedEvent ¶
RestartedEvent creates a new Restarted in progress Event
func RestartingEvent ¶
RestartingEvent creates a new Restarting in progress Event
func RunningEvent ¶
RunningEvent creates a new Running in progress Event
func StartedEvent ¶
StartedEvent creates a new Started in progress Event
func StartingEvent ¶
StartingEvent creates a new Starting in progress Event
func StoppedEvent ¶
StoppedEvent creates a new Stopping in progress Event
func StoppingEvent ¶
StoppingEvent creates a new Stopping in progress Event
func Waiting ¶
Waiting creates a new waiting event
type EventStatus ¶
type EventStatus int
EventStatus indicates the status of an action
const ( // Working means that the current task is working Working EventStatus = iota // Done means that the current task is done Done // Error means that the current task has errored Error )
type Writer ¶
type Writer interface { Start(context.Context) error Stop() Event(Event) Events([]Event) TailMsgf(string, ...interface{}) }
Writer can write multiple progress events
func ContextWriter ¶
ContextWriter returns the writer from the context
func NewWriter ¶
NewWriter returns a new multi-progress writer
Source Files ¶
event.go noop.go plain.go spinner.go tty.go writer.go
- Version
- v2.3.2
- Published
- Mar 8, 2022
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 13 minutes ago –
Tools for package owners.