internal

package
v0.0.0-...-b6e3791 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package internal contains common constants and types that all implementations of the default profile-cache use.

Index

Constants

View Source
const CacheVersionError errors.Error = "unsuitable cache version"

CacheVersionError is returned from [FileCacheStorage.Load] method if the stored cache version doesn't match current FileCacheVersion.

View Source
const FileCacheVersion = 9

FileCacheVersion is the version of cached data structure. It must be manually incremented on every change in agd.Device, agd.Profile, and any file-cache structures.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyFileCacheStorage

type EmptyFileCacheStorage struct{}

EmptyFileCacheStorage is the empty file-cache storage that does nothing and returns nils.

func (EmptyFileCacheStorage) Load

func (EmptyFileCacheStorage) Load() (_ *FileCache, _ error)

Load implements the FileCacheStorage interface for EmptyFileCacheStorage. It does nothing and returns nils.

func (EmptyFileCacheStorage) Store

func (EmptyFileCacheStorage) Store(_ *FileCache) (_ error)

Store implements the FileCacheStorage interface for EmptyFileCacheStorage. It does nothing and returns nil.

type FileCache

type FileCache struct {
	SyncTime time.Time
	Profiles []*agd.Profile
	Devices  []*agd.Device
	Version  int32
}

FileCache contains the data that is cached on the filesystem.

type FileCacheStorage

type FileCacheStorage interface {
	// Load read the data from the cache file.  If the file does not exist, Load
	// must return a nil *FileCache.  Load must return an informative error.
	Load() (c *FileCache, err error)

	// Store writes the data to the cache file.  c must not be nil.  Store must
	// return an informative error.
	Store(c *FileCache) (err error)
}

FileCacheStorage is the interface for all file caches.

Directories

Path Synopsis
Package filecachepb contains the protobuf structures for the profile cache.
Package filecachepb contains the protobuf structures for the profile cache.
Package profiledbtest contains common helpers for profile-database tests.
Package profiledbtest contains common helpers for profile-database tests.

Jump to

Keyboard shortcuts

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