statefile

package
v0.14.0-pgescape Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const StateStructVersion = 20220411

Variables

This section is empty.

Functions

This section is empty.

Types

type LegacyState

type LegacyState struct {
	LastCheck      string `json:"lastChecked"`    // an RFC3339 encoded time stamp
	InstallationID string `json:"installationId"` // a UUIDv4 string
}

LegacyState is a struct used to migrate the State to serialize with snake case property names(migrated in v0.14.0)

type State

type State struct {
	LastCheck      string `json:"last_checked"`    // an RFC3339 encoded time stamp
	InstallationID string `json:"installation_id"` // a UUIDv4 string
	StructVersion  int64  `json:"struct_version"`
}

State is a struct containing installation state

func LoadState

func LoadState() (State, error)

func (*State) IsValid added in v0.14.0

func (s *State) IsValid() bool

IsValid checks whether the struct was correctly deserialized, by checking if the StructVersion is populated

func (*State) MigrateFrom added in v0.14.0

func (s *State) MigrateFrom(prev interface{}) migrate.Migrateable

func (*State) Save

func (s *State) Save() error

Save the state NOTE: this updates the last checked time

Jump to

Keyboard shortcuts

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