Versions in this module Expand all Collapse all v1 v1.4.1 Dec 29, 2021 v1.4.0 Apr 19, 2021 Changes in this version type State + const StateStopped v1.3.2 Dec 30, 2020 Changes in this version + var ErrStepIDShouldBeUnique = errors.New("progress.AddStep requires a unique ID as argument") + var ErrStepRequiresID = errors.New("progress.AddStep requires a non-empty ID as argument") + type Progress struct + CreatedAt time.Time + Steps []*Step + func New() *Progress + func (p *Progress) AddStep(id string) *Step + func (p *Progress) Close() + func (p *Progress) Get(id string) *Step + func (p *Progress) MarshalJSON() ([]byte, error) + func (p *Progress) Progress() float64 + func (p *Progress) SafeAddStep(id string) (*Step, error) + func (p *Progress) Snapshot() Snapshot + func (p *Progress) Subscribe() chan *Step + type Snapshot struct + Completed int + CompletionEstimate time.Duration + Doing string + DoneAt *time.Time + InProgress int + NotStarted int + Progress float64 + StartedAt *time.Time + State State + StepDuration time.Duration + Total int + TotalDuration time.Duration + type State string + const StateDone + const StateInProgress + const StateNotStarted + type Step struct + Data interface{} + Description string + DoneAt *time.Time + ID string + Progress float64 + StartedAt *time.Time + State State + func (s *Step) Done() *Step + func (s *Step) Duration() time.Duration + func (s *Step) MarshalJSON() ([]byte, error) + func (s *Step) SetAsCurrent() *Step + func (s *Step) SetData(data interface{}) *Step + func (s *Step) SetDescription(desc string) *Step + func (s *Step) SetProgress(progress float64) *Step + func (s *Step) Start() *Step