Documentation ¶
Index ¶
- func Run(ctx context.Context, pf progressFunc) (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 NewEvent(ID string, status EventStatus, statusText string) Event
- func RemovedEvent(ID string) Event
- func RemovingEvent(ID string) Event
- func RunningEvent(ID string) Event
- func StartedEvent(ID string) Event
- func StartingEvent(ID string) Event
- func StoppingEvent(ID string) Event
- type EventStatus
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶ added in v1.0.4
CreatedEvent creates a new Created (done) Event
func CreatingEvent ¶ added in v1.0.4
CreatingEvent creates a new Create in progress Event
func ErrorEvent ¶ added in v1.0.4
ErrorEvent creates a new Error Event
func ErrorMessageEvent ¶ added in v1.0.4
ErrorMessageEvent creates a new Error Event with message
func NewEvent ¶ added in v1.0.4
func NewEvent(ID string, status EventStatus, statusText string) Event
NewEvent new event
func RemovedEvent ¶ added in v1.0.4
RemovedEvent creates a new removed (done) Event
func RemovingEvent ¶ added in v1.0.4
RemovingEvent creates a new Removing in progress Event
func RunningEvent ¶ added in v1.0.4
RunningEvent creates a new Running in progress Event
func StartedEvent ¶ added in v1.0.4
StartedEvent creates a new Started in progress Event
func StartingEvent ¶ added in v1.0.4
StartingEvent creates a new Starting in progress Event
func StoppingEvent ¶ added in v1.0.4
StoppingEvent stops a new Removing 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 )
type Writer ¶
Writer can write multiple progress events
func ContextWriter ¶
ContextWriter returns the writer from the context