state

package
v0.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2025 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles state persistence

func NewManager

func NewManager(workDir string) *Manager

NewManager creates a new state manager

func (*Manager) Load

func (m *Manager) Load() (*State, error)

Load reads the state from disk

func (*Manager) Save

func (m *Manager) Save(state *State) error

Save writes the state to disk

type State

type State struct {
	LastBatchRun time.Time `json:"lastBatchRun"`
}

State represents the persistent state of gitsyncer

func (*State) HasRunWithinWeek

func (s *State) HasRunWithinWeek() bool

HasRunWithinWeek checks if the last batch run was within the past week

func (*State) UpdateBatchRunTime

func (s *State) UpdateBatchRunTime()

UpdateBatchRunTime updates the last batch run timestamp to now

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL