local

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package local is a local file system cache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileCache

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

Cache DB implementation

func NewFileCache

func NewFileCache(path string, vacuum time.Duration, memory bool) (*FileCache, error)

NewFileCache creates a new file cache

func (*FileCache) Check

func (c *FileCache) Check(refresh bool) bool

Check availability of the cache

func (*FileCache) Delete

func (c *FileCache) Delete(path string)

Delete deletes the cache file

func (*FileCache) DeleteAll

func (c *FileCache) DeleteAll(flushType string)

DeleteAll deletes all the cache files

func (*FileCache) Get

func (c *FileCache) Get(key string, etag string) ([]byte, bool, error)

Get returns the value for the given key

func (*FileCache) Set

func (c *FileCache) Set(key string, val []byte, expiry time.Duration, etag string) error

Set sets the value for the given key into the cache

type FileLock

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

func (*FileLock) Lock

func (l *FileLock) Lock()

func (*FileLock) RLock

func (l *FileLock) RLock()

func (*FileLock) RUnlock

func (l *FileLock) RUnlock()

func (*FileLock) Unlock

func (l *FileLock) Unlock()

type PathMutex

type PathMutex struct {
	Lock map[string]*FileLock
	// contains filtered or unexported fields
}

func (*PathMutex) MutexAt

func (m *PathMutex) MutexAt(path string) *FileLock

Jump to

Keyboard shortcuts

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