Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(s Storage, opts ...CacheOption) datastore.Middleware
Types ¶
type CacheOption ¶
type CacheOption interface {
Apply(*cacheHandler)
}
func WithExcludeKinds ¶
func WithExcludeKinds(kinds ...string) CacheOption
func WithIncludeKinds ¶
func WithIncludeKinds(kinds ...string) CacheOption
func WithKeyFilter ¶
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 dsmiddleware, 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 }
Click to show internal directories.
Click to hide internal directories.