sqlite

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsClient

func AsClient(client interface{}) *cove.Cache

func New

func New() cache.Cache

New creates and returns a new SQLite cacher.

Types

type SQLiteCacher

type SQLiteCacher struct {
	cache.GetAs
	// contains filtered or unexported fields
}

SQLiteCacher represents a SQLite cache adapter implementation.

func (*SQLiteCacher) Client

func (c *SQLiteCacher) Client() interface{}

func (*SQLiteCacher) Close

func (c *SQLiteCacher) Close() error

func (*SQLiteCacher) Codec

func (c *SQLiteCacher) Codec() encoding.Codec

func (*SQLiteCacher) Decr

func (c *SQLiteCacher) Decr(ctx context.Context, key string) error

Decr cached int value.

func (*SQLiteCacher) Delete

func (c *SQLiteCacher) Delete(ctx context.Context, key string) error

Delete deletes cached value by given key.

func (*SQLiteCacher) Flush

func (c *SQLiteCacher) Flush(ctx context.Context) error

Flush deletes all cached data.

func (*SQLiteCacher) Get

func (c *SQLiteCacher) Get(ctx context.Context, key string, value interface{}) error

Get gets cached value by given key.

func (*SQLiteCacher) Incr

func (c *SQLiteCacher) Incr(ctx context.Context, key string) error

Incr increases cached int-type value by given key as a counter.

func (*SQLiteCacher) IsExist

func (c *SQLiteCacher) IsExist(ctx context.Context, key string) (bool, error)

IsExist returns true if cached value exists.

func (*SQLiteCacher) Name

func (c *SQLiteCacher) Name() string

func (*SQLiteCacher) Put

func (c *SQLiteCacher) Put(ctx context.Context, key string, val interface{}, expire int64) error

Put puts value into cache with key and expire time. If expired is 0, it will be deleted by next GC operation.

func (*SQLiteCacher) SetCodec

func (c *SQLiteCacher) SetCodec(codec encoding.Codec)

func (*SQLiteCacher) StartAndGC

func (c *SQLiteCacher) StartAndGC(ctx context.Context, opt cache.Options) (err error)

StartAndGC starts GC routine based on config string settings.

Jump to

Keyboard shortcuts

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