cache

package
v0.0.0-...-80c8c53 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = ".optimizer_cache"

Variables

View Source
var (
	ErrIsNotDirectory   = errors.New("element is not directory")
	ErrPathDoesNotExist = errors.New("path does not exist")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Has(key string) bool
	Get(key string) *FileInfo
	Put(key string, value *FileInfo)
	Verify(file string) (*FileInfo, error)
	AddFile(file string) error
	Save() error
	Dir() string
}

func Load

func Load(dir string) (Cache, error)

type Data

type Data map[string]*FileInfo

type FileInfo

type FileInfo struct {
	Hash    string              `json:"hash"`
	Results OptimizersToResults `json:"results,omitempty"`
}

type LocalCache

type LocalCache struct {
	// contains filtered or unexported fields
}

func NewEmptyCache

func NewEmptyCache(dir string) *LocalCache

func (*LocalCache) AddFile

func (c *LocalCache) AddFile(file string) error

func (*LocalCache) Dir

func (c *LocalCache) Dir() string

func (*LocalCache) Get

func (c *LocalCache) Get(key string) *FileInfo

func (*LocalCache) Has

func (c *LocalCache) Has(key string) bool

func (*LocalCache) Put

func (c *LocalCache) Put(key string, value *FileInfo)

func (*LocalCache) Save

func (c *LocalCache) Save() error

func (*LocalCache) Verify

func (c *LocalCache) Verify(file string) (*FileInfo, error)

type OptimizersToResults

type OptimizersToResults map[string]int

Jump to

Keyboard shortcuts

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