cache

package module
v0.0.5-rc Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

Golang implementation of Laravel cache

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCacheService

func NewCacheService(store Store) (*cacheService, error)

New instance of simply cache

Types

type Service

type Service interface {
	Get(keys ...string) ([]byte, error)
	Increment(key string, value uint64) (uint64, error)
	Decrement(key string, value uint64) (uint64, error)
	Tags(keys ...string) (*TaggedCacheService, error)
}

Service is interface to cache service

type Store

type Store interface {
	Get(key string) ([]byte, error)
	Increment(key string, value uint64) (uint64, error)
	Decrement(key string, value uint64) (uint64, error)
	Forever(key string, value []byte) (bool, error)
	GetPrefix() string
}

Store is interface to cache store

type TagSet

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

store is a collection of method to access to store

func NewTagSet

func NewTagSet(store Store, names ...string) *TagSet

NewTagSet instance of for tagged cache

type TaggedCacheService

type TaggedCacheService struct {
	TagSet *TagSet
	Store  Store
	// contains filtered or unexported fields
}

TaggedCacheService ...

func NewTaggedCacheService

func NewTaggedCacheService(store Store, names ...string) (*TaggedCacheService, error)

NewTaggedCacheService instance of tagged cache

func (*TaggedCacheService) Decrement

func (tc *TaggedCacheService) Decrement(key string, value uint64) (uint64, error)

func (*TaggedCacheService) Get

func (tc *TaggedCacheService) Get(keys ...string) ([]byte, error)

func (*TaggedCacheService) Increment

func (tc *TaggedCacheService) Increment(key string, value uint64) (uint64, error)

func (*TaggedCacheService) Tags

func (tc *TaggedCacheService) Tags(keys ...string) (*TaggedCacheService, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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