marshaler

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 4 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Marshaler

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

Marshaler is the struct that marshal and unmarshal cache values

func New

func New(cache cache.CacheInterface) *Marshaler

New creates a new marshaler that marshals/unmarshals cache values

func (*Marshaler) Clear

func (c *Marshaler) Clear(ctx context.Context) error

Clear reset all cache data

func (*Marshaler) Delete

func (c *Marshaler) Delete(ctx context.Context, key interface{}) error

Delete removes a value from the cache

func (*Marshaler) Get

func (c *Marshaler) Get(ctx context.Context, key interface{}, returnObj interface{}) (interface{}, error)

Get obtains a value from cache and unmarshal value with given object

func (*Marshaler) Invalidate

func (c *Marshaler) Invalidate(ctx context.Context, options store.InvalidateOptions) error

Invalidate invalidate cache values using given options

func (*Marshaler) Set

func (c *Marshaler) Set(ctx context.Context, key, object interface{}, options *store.Options) error

Set sets a value in cache by marshaling value

Jump to

Keyboard shortcuts

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