evcache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Get(ctx context.Context, key interface{}) (interface{}, error)
	Set(ctx context.Context, key, object interface{}) error
}

Interface is Cache interface

func NewCache

func NewCache(cache cache.CacheInterface[any], option ...store.Option) Interface

NewCache instantiates adapter for cache.CacheInterface

func NewCacheMarshaller

func NewCacheMarshaller(marshaller Marshaler, returnObj MarshallerReturnObj, option ...store.Option) Interface

NewCacheMarshaller generates adapter for marshaler.Marshaler

type Marshaler

type Marshaler interface {
	Get(ctx context.Context, key interface{}, returnObj interface{}) (interface{}, error)
	Set(ctx context.Context, key, object interface{}, options ...store.Option) error
	Delete(ctx context.Context, key interface{}) error
	Invalidate(ctx context.Context, options ...store.InvalidateOption) error
	Clear(ctx context.Context) error
}

Marshaler is interface for marshaler.Marshaler

type MarshallerReturnObj

type MarshallerReturnObj func() interface{}

MarshallerReturnObj generates returned object to fill by marshaler.Marshaler

Jump to

Keyboard shortcuts

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