cache

package module
v0.0.0-...-556c653 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

README

cache

Documentation

Index

Constants

View Source
const DuplicateEntryError = "Duplicate entry"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(key string, value []byte) (ok bool)
	Get(key string) (value []byte)
	Remove(key string) (ok bool)
}

func NewDbCache

func NewDbCache(db *gorm.DB, opts ...Option) (Cache, error)

func NewLocalCache

func NewLocalCache(opts ...Option) (Cache, error)

type DataCacheTable

type DataCacheTable struct {
	Id         int64         `gorm:"id"`
	Key        string        `gorm:"key"`
	Value      []byte        `gorm:"value"`
	Timeout    time.Duration `gorm:"timeout"`
	CreateTime time.Time     `gorm:"create_time"`
}

type Option

type Option func(options *Options)

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Options

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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