Versions in this module Expand all Collapse all v1 v1.0.1 Feb 21, 2024 v1.0.0 Feb 21, 2024 Changes in this version + type Metrics struct + Scope promutils.Scope + SnapshotCreationErrCounter prometheus.Counter + SnapshotSaveErrCounter prometheus.Counter + type Persistence interface + Read func(ctx context.Context, reader Reader) (Snapshot, error) + Save func(ctx context.Context, writer Writer, snapshot Snapshot) + func New(scope promutils.Scope, db repositoryInterfaces.SchedulerRepoInterface) Persistence + type Reader interface + ReadSnapshot func(reader io.Reader) (Snapshot, error) + type Snapshot interface + Create func() Snapshot + Deserialize func(snapshot []byte) error + GetLastExecutionTime func(key string) *time.Time + GetVersion func() int + IsEmpty func() bool + Serialize func() ([]byte, error) + UpdateLastExecutionTime func(key string, lastExecTime *time.Time) + type SnapshotV1 struct + LastTimes map[string]*time.Time + func (s *SnapshotV1) Create() Snapshot + func (s *SnapshotV1) Deserialize(snapshot []byte) error + func (s *SnapshotV1) GetLastExecutionTime(key string) *time.Time + func (s *SnapshotV1) GetVersion() int + func (s *SnapshotV1) IsEmpty() bool + func (s *SnapshotV1) Serialize() ([]byte, error) + func (s *SnapshotV1) UpdateLastExecutionTime(key string, lastExecTime *time.Time) + type VersionedSnapshot struct + Ser []byte + Version int + func (s *VersionedSnapshot) ReadSnapshot(r io.Reader) (Snapshot, error) + func (s *VersionedSnapshot) WriteSnapshot(w io.Writer, snapshot Snapshot) error + type Writer interface + WriteSnapshot func(writer io.Writer, snapshot Snapshot) error