marshaler

package
v3.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 4 Imported by: 0

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[any]) *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 any) error

Delete removes a value from the cache

func (*Marshaler) Get

func (c *Marshaler) Get(ctx context.Context, key any, returnObj any) (any, 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.InvalidateOption) error

Invalidate invalidate cache values using given options

func (*Marshaler) Set

func (c *Marshaler) Set(ctx context.Context, key, object any, options ...store.Option) 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