database

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseDriver

type DatabaseDriver interface {

	// Get a value from the database.
	Get(string) ([]byte, error)

	// Set a value to the database.
	Set(string, any) error

	Close() error
}

func NewDatabase

func NewDatabase(_options *options.Config) (DatabaseDriver, error)

Create a new database instance.

func NewRedisDatabase

func NewRedisDatabase(_options *options.Config) (DatabaseDriver, error)

Create a new cache instance.

func NewSQLiteDatabase

func NewSQLiteDatabase(_options *options.Config) (DatabaseDriver, error)

Create a new cache instance.

type RedisDatabase

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

func (*RedisDatabase) Close added in v1.1.0

func (db *RedisDatabase) Close() error

func (*RedisDatabase) Get

func (db *RedisDatabase) Get(key string) ([]byte, error)

Retrieve data from redis.

func (*RedisDatabase) Set

func (db *RedisDatabase) Set(key string, value any) error

Store data to cache.

type SQLiteDatabase

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

func (*SQLiteDatabase) Close added in v1.1.0

func (db *SQLiteDatabase) Close() error

func (*SQLiteDatabase) Get

func (db *SQLiteDatabase) Get(key string) ([]byte, error)

Retrieve data from redis.

func (*SQLiteDatabase) Set

func (db *SQLiteDatabase) Set(key string, value any) error

Store data to cache.

Jump to

Keyboard shortcuts

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