filesystem

package
v0.0.0-...-4af24e4 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package filesystem provides a filesystem cache implementation for onecache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePathKeyFunc

func FilePathKeyFunc(s string) string

Types

type FSStore

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

func MustNewFSStore

func MustNewFSStore(baseDir string) *FSStore

func New

func New(opts ...Option) (*FSStore, error)

func (*FSStore) Delete

func (fs *FSStore) Delete(key string) error

func (*FSStore) Flush

func (fs *FSStore) Flush() error

func (*FSStore) GC

func (fs *FSStore) GC()

func (*FSStore) Get

func (fs *FSStore) Get(key string) ([]byte, error)

func (*FSStore) Has

func (fs *FSStore) Has(key string) bool

func (*FSStore) Set

func (fs *FSStore) Set(key string, data []byte, expiresAt time.Duration) error

type Option

type Option func(fs *FSStore)

Option is an optional type

func BaseDirectory

func BaseDirectory(base string) Option

func CacheKeyGenerator

func CacheKeyGenerator(fn onecache.KeyFunc) Option

func Serializer

func Serializer(serializer onecache.Serializer) Option

Jump to

Keyboard shortcuts

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