cache

package
v0.0.0-...-cd88b06 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cache maintains the caching of all meta data of the files and directories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

type BoltDB struct {
	*bolt.DB
}

DB -

func (*BoltDB) Add

func (db *BoltDB) Add(ns string, f *fs.File) error

func (*BoltDB) Delete

func (db *BoltDB) Delete(ns, name string) error

func (*BoltDB) Get

func (db *BoltDB) Get(ns, name string) (*fs.File, error)

func (*BoltDB) Update

func (db *BoltDB) Update(ns, name string, new *fs.File) (*fs.File, error)

type Cache

type Cache interface {
	Add(ns string, f *fs.File) error
	Get(ns, name string) (*fs.File, error)
	Update(ns, name string, new *fs.File) (*fs.File, error)
	Delete(ns, name string) error
}

func NewCache

func NewCache(t, p string, mode os.FileMode) (Cache, error)

func Open

func Open(path string, mode os.FileMode) (Cache, error)

Open -

type Memory

type Memory struct {
	Namespace map[string]*fs.Namespace
	Files     map[string]map[string]*fs.File
	// contains filtered or unexported fields
}

DB -

func (*Memory) Add

func (db *Memory) Add(ns string, f *fs.File) error

func (*Memory) Delete

func (db *Memory) Delete(ns, name string) error

func (*Memory) Get

func (db *Memory) Get(ns, name string) (*fs.File, error)

func (*Memory) Update

func (db *Memory) Update(ns, name string, new *fs.File) (*fs.File, error)

Jump to

Keyboard shortcuts

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