cache

package
v2.0.0-alpha1+incompat... Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheMap map[string]*Item

CacheMap store UUID, size, type, atime and ctime in separate (sorted) table for access by fileReaper

View Source
var CacheMapLock = sync.RWMutex{}

CacheMapLock lock write access to the CacheMap

Functions

func Add

func Add(ID string, size int64)

Add an entry to the Cache for ID

func Initialize

func Initialize() (err error)

Initialize find all *.data files for nodes and populate cache only call if global --is-cache=true

func Remove

func Remove(ID string) (err error)

Remove an entry to the CacheMap and the file on disk

func Touch

func Touch(ID string)

Touch update cache LRU info

Types

type Item

type Item struct {
	UUID      string    `bson:"uuid" json:"uuid" `                   // e.g. node UUID
	Access    time.Time `bson:"last_accessed" json:"last_accessed" ` // e.g. access time
	Type      string    `bson:"type" json:"type"`
	Size      int64     `bson:"size" json:"size"  `        // e.g. size in bytes
	CreatedOn time.Time `bson:"url" json:"url" yaml:"URL"` // e.g. creation of local copy
}

Item information to manage file expiration on cache servers

Jump to

Keyboard shortcuts

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