Documentation ¶
Index ¶
- Constants
- Variables
- 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
Constants ¶
const ( // ModeAuto detect console capabilities ModeAuto = "auto" // ModeTTY use terminal capability for advanced rendering ModeTTY = "tty" // ModePlain dump raw events to output ModePlain = "plain" )
Variables ¶
var Mode = ModeAuto
Mode define how progress should be rendered, either as ModePlain or ModeTTY
Functions ¶
func RunWithStatus ¶
RunWithStatus will run a writer and the progress function in parallel and return a status
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 ErrorMessageEvent ¶
ErrorMessageEvent creates a new Error Event with message
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
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 // Warning means that the current task has warning Warning )