cachestore

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cachestore use for custom store for caching historical currency rates

Index

Constants

View Source
const MySQLType = "mysql"

MySQLType represents the storage type as a string value

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLStore

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

MySQLStore used for store immutable (historical) currency rates in L2 cache in database (MySQL)

func NewMySQLStore

func NewMySQLStore(client *gorm.DB, options *store.Options) *MySQLStore

NewMySQLStore creates a new store to Memcache instance(s)

func (*MySQLStore) Clear

func (store *MySQLStore) Clear() error

Clear does not affected, as MySQLStore is persistent storage

func (*MySQLStore) Delete

func (store *MySQLStore) Delete(key interface{}) error

Delete does not affected, as MySQLStore is persistent storage

func (*MySQLStore) Get

func (store *MySQLStore) Get(key interface{}) (interface{}, error)

Get gets value by key

func (*MySQLStore) GetType

func (store *MySQLStore) GetType() string

GetType returns type for store

func (*MySQLStore) GetWithTTL

func (store *MySQLStore) GetWithTTL(key interface{}) (interface{}, time.Duration, error)

GetWithTTL gets value and ttl by key

func (*MySQLStore) Invalidate

func (store *MySQLStore) Invalidate(options store.InvalidateOptions) error

Invalidate does not affected, as MySQLStore is persistent storage

func (*MySQLStore) Set

func (store *MySQLStore) Set(key interface{}, value interface{}, options *store.Options) error

Set store value in cache

Jump to

Keyboard shortcuts

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