Versions in this module Expand all Collapse all v0 v0.1.0 Nov 12, 2022 v0.0.1 Nov 10, 2022 Changes in this version + const LogError + const LogInfo + var DefaultExpireAfter = time.Hour * 24 * 28 + var DefaultRepeatAfter = time.Hour * 24 + var ErrNoState = errors.New("no state entry for key") + func CopyState(srcStatePath, dstStatePath string, dataEntries []string) error + func MockTime(now time.Time) (restore func()) + func TagTimingsWithChange(t *timings.Timings, change *Change) + func TimingsForTask(task *Task) *timings.Timings + type Backend interface + Checkpoint func(data []byte) error + EnsureBefore func(d time.Duration) + type Change struct + func (c *Change) Abort() + func (c *Change) AbortLanes(lanes []int) + func (c *Change) AbortUnreadyLanes() + func (c *Change) AddAll(ts *TaskSet) + func (c *Change) AddTask(t *Task) + func (c *Change) CheckTaskDependencies() error + func (c *Change) Err() error + func (c *Change) Get(key string, value interface{}) error + func (c *Change) Has(key string) bool + func (c *Change) ID() string + func (c *Change) IsClean() bool + func (c *Change) IsReady() bool + func (c *Change) Kind() string + func (c *Change) LaneTasks(lanes ...int) []*Task + func (c *Change) MarshalJSON() ([]byte, error) + func (c *Change) Ready() <-chan struct{} + func (c *Change) ReadyTime() time.Time + func (c *Change) Set(key string, value interface{}) + func (c *Change) SetStatus(s Status) + func (c *Change) SpawnTime() time.Time + func (c *Change) State() *State + func (c *Change) Status() Status + func (c *Change) Summary() string + func (c *Change) Tasks() []*Task + func (c *Change) UnmarshalJSON(data []byte) error + type HandlerFunc func(task *Task, tomb *tomb.Tomb) error + type Hold struct + Reason string + func (r *Hold) Error() string + type NoStateError struct + Key string + func (e *NoStateError) Error() string + func (e *NoStateError) Is(err error) bool + type Retry struct + After time.Duration + Reason string + func (r *Retry) Error() string + type State struct + func New(backend Backend) *State + func ReadState(backend Backend, r io.Reader) (*State, error) + func (s *State) AllWarnings() []*Warning + func (s *State) Cache(key, value interface{}) + func (s *State) Cached(key interface{}) interface{} + func (s *State) Change(id string) *Change + func (s *State) Changes() []*Change + func (s *State) EnsureBefore(d time.Duration) + func (s *State) Get(key string, value interface{}) error + func (s *State) GetMaybeTimings(timings interface{}) error + func (s *State) Has(key string) bool + func (s *State) Lock() + func (s *State) MarshalJSON() ([]byte, error) + func (s *State) Modified() bool + func (s *State) NewChange(kind, summary string) *Change + func (s *State) NewLane() int + func (s *State) NewTask(kind, summary string) *Task + func (s *State) OkayWarnings(t time.Time) int + func (s *State) PendingWarnings() ([]*Warning, time.Time) + func (s *State) Prune(startOfOperation time.Time, pruneWait, abortWait time.Duration, ...) + func (s *State) RegisterPendingChangeByAttr(attr string, f func(*Change) bool) + func (s *State) SaveTimings(timings interface{}) + func (s *State) Set(key string, value interface{}) + func (s *State) Task(id string) *Task + func (s *State) TaskCount() int + func (s *State) Tasks() []*Task + func (s *State) Unlock() + func (s *State) UnmarshalJSON(data []byte) error + func (s *State) UnshowAllWarnings() + func (s *State) Warnf(template string, args ...interface{}) + func (s *State) WarningsSummary() (int, time.Time) + type Status int + const AbortStatus + const DefaultStatus + const DoStatus + const DoingStatus + const DoneStatus + const ErrorStatus + const HoldStatus + const UndoStatus + const UndoingStatus + const UndoneStatus + func (s Status) Ready() bool + func (s Status) String() string + type Task struct + func (t *Task) At(when time.Time) + func (t *Task) AtTime() time.Time + func (t *Task) Change() *Change + func (t *Task) Clear(key string) + func (t *Task) DoingTime() time.Duration + func (t *Task) Errorf(format string, args ...interface{}) + func (t *Task) Get(key string, value interface{}) error + func (t *Task) HaltTasks() []*Task + func (t *Task) Has(key string) bool + func (t *Task) ID() string + func (t *Task) IsClean() bool + func (t *Task) JoinLane(lane int) + func (t *Task) Kind() string + func (t *Task) Lanes() []int + func (t *Task) Log() []string + func (t *Task) Logf(format string, args ...interface{}) + func (t *Task) MarshalJSON() ([]byte, error) + func (t *Task) NumHaltTasks() int + func (t *Task) Progress() (label string, done, total int) + func (t *Task) ReadyTime() time.Time + func (t *Task) Set(key string, value interface{}) + func (t *Task) SetClean() + func (t *Task) SetProgress(label string, done, total int) + func (t *Task) SetStatus(new Status) + func (t *Task) SpawnTime() time.Time + func (t *Task) State() *State + func (t *Task) Status() Status + func (t *Task) Summary() string + func (t *Task) UndoingTime() time.Duration + func (t *Task) UnmarshalJSON(data []byte) error + func (t *Task) WaitAll(ts *TaskSet) + func (t *Task) WaitFor(another *Task) + func (t *Task) WaitTasks() []*Task + type TaskDependencyCycleError struct + IDs []string + func (e *TaskDependencyCycleError) Error() string + func (e *TaskDependencyCycleError) Is(err error) bool + type TaskRunner struct + func NewTaskRunner(s *State) *TaskRunner + func (r *TaskRunner) AddBlocked(pred func(t *Task, running []*Task) bool) + func (r *TaskRunner) AddCleanup(kind string, cleanup HandlerFunc) + func (r *TaskRunner) AddHandler(kind string, do, undo HandlerFunc) + func (r *TaskRunner) AddOptionalHandler(match func(t *Task) bool, do, undo HandlerFunc) + func (r *TaskRunner) Ensure() error + func (r *TaskRunner) KnownTaskKinds() []string + func (r *TaskRunner) OnTaskError(f func(err error)) + func (r *TaskRunner) SetBlocked(pred func(t *Task, running []*Task) bool) + func (r *TaskRunner) Stop() + func (r *TaskRunner) StopKinds(kind ...string) + func (r *TaskRunner) Wait() + type TaskSet struct + func NewTaskSet(tasks ...*Task) *TaskSet + func (ts *TaskSet) AddAll(anotherTs *TaskSet) + func (ts *TaskSet) AddAllWithEdges(anotherTs *TaskSet) error + func (ts *TaskSet) AddTask(task *Task) + func (ts *TaskSet) JoinLane(lane int) + func (ts *TaskSet) MarkEdge(task *Task, edge TaskSetEdge) + func (ts *TaskSet) WaitAll(anotherTs *TaskSet) + func (ts TaskSet) Edge(e TaskSetEdge) (*Task, error) + func (ts TaskSet) MaybeEdge(e TaskSetEdge) *Task + func (ts TaskSet) Tasks() []*Task + func (ts TaskSet) WaitFor(another *Task) + type TaskSetEdge string + type Warning struct + func (w *Warning) ExpiredBefore(now time.Time) bool + func (w *Warning) MarshalJSON() ([]byte, error) + func (w *Warning) ShowAfter(t time.Time) bool + func (w *Warning) String() string + func (w *Warning) UnmarshalJSON(data []byte) error