cache

package
v0.0.0-...-7c51b95 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDriverNotFound = errors.New(`driver not found`)
)

Functions

func New

func New(config *Configuration) contract.Cache

Create a cache manager

func NewRepository

func NewRepository(store contract.CacheStore) contract.CacheSerializable

Create a new cache repository

Types

type Cache

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

func (*Cache) Add

func (c *Cache) Add(key string, value interface{}, expire time.Time) error

func (*Cache) AddEncode

func (c *Cache) AddEncode(key string, value interface{}, expire time.Time) error

func (*Cache) Decrement

func (c *Cache) Decrement(key string, steps ...int64) error

func (*Cache) Driver

func (c *Cache) Driver(driver string) contract.CacheSerializable

Get the cache driver of the finger

func (*Cache) Flush

func (c *Cache) Flush() error

func (*Cache) Forever

func (c *Cache) Forever(key string, value interface{}) error

func (*Cache) ForeverEncode

func (c *Cache) ForeverEncode(key string, value interface{}) error

func (*Cache) Forget

func (c *Cache) Forget(key string) error

func (*Cache) Get

func (c *Cache) Get(key string) (interface{}, error)

func (*Cache) GetDecode

func (c *Cache) GetDecode(key string, to interface{}) (interface{}, error)

func (*Cache) GetDefault

func (c *Cache) GetDefault(key string, defaultValue interface{}) (interface{}, error)

func (*Cache) Has

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

func (*Cache) Increment

func (c *Cache) Increment(key string, steps ...int64) error

func (*Cache) Pull

func (c *Cache) Pull(key string) (interface{}, error)

func (*Cache) PullDefault

func (c *Cache) PullDefault(key string, defaultValue interface{}) (interface{}, error)

func (*Cache) Put

func (c *Cache) Put(key string, value interface{}, expire time.Time) error

func (*Cache) PutEncode

func (c *Cache) PutEncode(key string, value interface{}, expire time.Time) error

func (*Cache) Register

func (c *Cache) Register(driver string, store contract.CacheStore)

Register driver

func (*Cache) Store

func (c *Cache) Store() contract.CacheStore

type Configuration

type Configuration struct {
	Prefix       string
	Default      string `json:"default" yaml:"default"`
	Repositories map[string]struct {
		Connection string `json:"connection" yaml:"connection"`
	} `json:"repositories" yaml:"repositories"`
}

type Provider

type Provider struct {
	kernel.BaseProvider
}

func (*Provider) Boot

func (p *Provider) Boot()

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Register

func (p *Provider) Register()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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