cache

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CURRENT_CACHE_VERSION uint32 = 2

Variables

View Source
var (
	// ColferSizeMax is the upper limit for serial byte sizes.
	ColferSizeMax = 16 * 1024 * 1024
	// ColferListMax is the upper limit for the number of elements in a list.
	ColferListMax = 64 * 1024
)

Colfer configuration attributes

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	CacheKey string

	InstalledFiles *InstalledFilesCache
}

func (*CacheEntry) MarshalBinary

func (o *CacheEntry) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is cache.ColferMax.

func (*CacheEntry) MarshalLen

func (o *CacheEntry) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is cache.ColferMax.

func (*CacheEntry) MarshalTo

func (o *CacheEntry) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*CacheEntry) Unmarshal

func (o *CacheEntry) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, cache.ColferError and cache.ColferMax.

func (*CacheEntry) UnmarshalBinary

func (o *CacheEntry) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, cache.ColferError, cache.ColferTail and cache.ColferMax.

type ColferError

type ColferError int

ColferError signals a data mismatch as as a byte index.

func (ColferError) Error

func (i ColferError) Error() string

Error honors the error interface.

type ColferMax

type ColferMax string

ColferMax signals an upper limit breach.

func (ColferMax) Error

func (m ColferMax) Error() string

Error honors the error interface.

type ColferTail

type ColferTail int

ColferTail signals data continuation as a byte index.

func (ColferTail) Error

func (i ColferTail) Error() string

Error honors the error interface.

type DootCache

type DootCache struct {
	Version uint32

	Entries []*CacheEntry
}

func Load

func Load() DootCache

func (*DootCache) GetEntry

func (cache *DootCache) GetEntry(cacheKey string) *InstalledFilesCache

func (*DootCache) MarshalBinary

func (o *DootCache) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Entries will be replaced with a new value. The error return option is cache.ColferMax.

func (*DootCache) MarshalLen

func (o *DootCache) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is cache.ColferMax.

func (*DootCache) MarshalTo

func (o *DootCache) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Entries will be replaced with a new value.

func (*DootCache) Save

func (cache *DootCache) Save()

func (*DootCache) Unmarshal

func (o *DootCache) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, cache.ColferError and cache.ColferMax.

func (*DootCache) UnmarshalBinary

func (o *DootCache) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, cache.ColferError, cache.ColferTail and cache.ColferMax.

type InstalledFile

type InstalledFile struct {
	Path string

	Content string
}

func (*InstalledFile) MarshalBinary

func (o *InstalledFile) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is cache.ColferMax.

func (*InstalledFile) MarshalLen

func (o *InstalledFile) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is cache.ColferMax.

func (*InstalledFile) MarshalTo

func (o *InstalledFile) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*InstalledFile) Unmarshal

func (o *InstalledFile) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, cache.ColferError and cache.ColferMax.

func (*InstalledFile) UnmarshalBinary

func (o *InstalledFile) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, cache.ColferError, cache.ColferTail and cache.ColferMax.

type InstalledFilesCache

type InstalledFilesCache struct {
	Links []*InstalledFile
}
func (filesCache *InstalledFilesCache) GetLinks() SymlinkCollection

func (*InstalledFilesCache) MarshalBinary

func (o *InstalledFilesCache) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. All nil entries in o.Links will be replaced with a new value. The error return option is cache.ColferMax.

func (*InstalledFilesCache) MarshalLen

func (o *InstalledFilesCache) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is cache.ColferMax.

func (*InstalledFilesCache) MarshalTo

func (o *InstalledFilesCache) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic. All nil entries in o.Links will be replaced with a new value.

func (filesCache *InstalledFilesCache) SetLinks(links SymlinkCollection)

func (*InstalledFilesCache) Unmarshal

func (o *InstalledFilesCache) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, cache.ColferError and cache.ColferMax.

func (*InstalledFilesCache) UnmarshalBinary

func (o *InstalledFilesCache) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, cache.ColferError, cache.ColferTail and cache.ColferMax.

Jump to

Keyboard shortcuts

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