service

package
v0.0.0-...-8f20b89 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKey      = errors.New("No key found")
	ErrKeyExpired = errors.New("Key expired")
)

Functions

This section is empty.

Types

type Cache

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

func NewCacheService

func NewCacheService(defaultExpiration, cleanupInterval time.Duration) *Cache

func (Cache) DeleteAll

func (c Cache) DeleteAll(ctx context.Context, in *empty.Empty) (*pb.Response, error)

func (Cache) DeleteKey

func (c Cache) DeleteKey(ctx context.Context, args *pb.Key) (*pb.Response, error)

func (Cache) Get

func (c Cache) Get(ctx context.Context, args *pb.Key) (*pb.String, error)

func (Cache) GetHashMap

func (c Cache) GetHashMap(ctx context.Context, args *pb.Key) (*pb.List, error)

func (Cache) GetList

func (c Cache) GetList(ctx context.Context, args *pb.Key) (*pb.List, error)

func (Cache) HMSet

func (c Cache) HMSet(ctx context.Context, item *pb.HashMapItem) (*pb.Response, error)

func (Cache) LPush

func (c Cache) LPush(ctx context.Context, item *pb.String) (*pb.Response, error)

func (Cache) RPush

func (c Cache) RPush(ctx context.Context, item *pb.String) (*pb.Response, error)

func (Cache) Set

func (c Cache) Set(ctx context.Context, item *pb.String) (*pb.Response, error)

Jump to

Keyboard shortcuts

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