Documentation ¶
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 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
- type EventStatus
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 )