Documentation
¶
Overview ¶
Package state persists resume-only state for dotdrift apply.
Index ¶
Constants ¶
const ( StatusFresh = "fresh" StatusInProgress = "in-progress" StatusComplete = "complete" StatusFailed = "failed" )
Status values for the apply pipeline.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileStore ¶
type FileStore struct {
Path string
}
FileStore saves state to a JSON file.
func NewFileStore ¶
NewFileStore returns a FileStore using the given path.
type State ¶
type State struct {
Selection string `json:"selection"`
Completed map[string]bool `json:"completed"`
Current string `json:"current"`
Status string `json:"status"`
Error string `json:"error"`
}
State holds the resume cursor and last error.
func Load ¶
Load reads state from the given path. If the file does not exist, it returns a default state.
func (*State) IsCompleted ¶
IsCompleted reports whether a step has been completed.
func (*State) MarkComplete ¶
MarkComplete records a step as completed and clears the current step/error.
func (*State) MarkCompletePipeline ¶
func (s *State) MarkCompletePipeline()
MarkCompletePipeline marks the pipeline as fully complete.
func (*State) MarkFailed ¶
MarkFailed records a step as the current failed step and stores the error.
func (*State) ResetForSelection ¶
func (s *State) ResetForSelection()
ResetForSelection clears runtime progress when the selection fingerprint changes.