storagecache

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type CacheItem

type CacheItem struct {
	Key          datastore.Key
	PropertyList datastore.PropertyList
}

type CacheOption added in v0.8.0

type CacheOption interface {
	Apply(*cacheHandler)
}

func WithExcludeKinds added in v0.8.0

func WithExcludeKinds(kinds ...string) CacheOption

func WithIncludeKinds added in v0.8.0

func WithIncludeKinds(kinds ...string) CacheOption

func WithKeyFilter added in v0.8.0

func WithKeyFilter(f func(key datastore.Key) bool) CacheOption

type Storage

type Storage interface {
	SetMulti(ctx context.Context, is []*CacheItem) error
	// GetMulti returns slice of CacheItem of the same length as Keys of the argument.
	// If not in the cache, the value of the corresponding element is nil.
	GetMulti(ctx context.Context, keys []datastore.Key) ([]*CacheItem, error)
	DeleteMulti(ctx context.Context, keys []datastore.Key) error
}

type TxOpLog

type TxOpLog struct {
	Ops          TxOps
	Key          datastore.Key
	PendingKey   datastore.PendingKey
	PropertyList datastore.PropertyList
}

type TxOps

type TxOps int
const (
	TxPutOp TxOps = iota
	TxGetOp
	TxDeleteOp
)

Jump to

Keyboard shortcuts

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