Documentation ¶
Overview ¶
Package packagestate contains structures for reading and writing the package status
Index ¶
Constants ¶
View Source
const CollectorPackageName = "observiq-otel-collector"
CollectorPackageName is the name for the top level packages for this collector
View Source
const DefaultFileName = "package_statuses.json"
DefaultFileName is the default name of the file use to store state
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStateManager ¶
type FileStateManager struct {
// contains filtered or unexported fields
}
FileStateManager manages state on disk via a JSON file
func (*FileStateManager) LoadStatuses ¶
func (p *FileStateManager) LoadStatuses() (*protobufs.PackageStatuses, error)
LoadStatuses retrieves the PackagesStatuses from a saved json file
func (*FileStateManager) SaveStatuses ¶
func (p *FileStateManager) SaveStatuses(statuses *protobufs.PackageStatuses) error
SaveStatuses saves the given PackageStatuses into a json file
type StateManager ¶
type StateManager interface { // LoadStatuses retrieves the previously saved PackagesStatuses. // If none were saved returns error LoadStatuses() (*protobufs.PackageStatuses, error) // SaveStatuses saves the given PackageStatuses SaveStatuses(statuses *protobufs.PackageStatuses) error }
StateManager tracks Package states
func NewFileStateManager ¶
func NewFileStateManager(logger *zap.Logger, jsonPath string) StateManager
NewFileStateManager creates a new PackagesStateManager
Click to show internal directories.
Click to hide internal directories.