sqlstore

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSQLStoreOption = SQLStoreOption{
	Ctx:       context.Background(),
	TableName: "echo_cache",
	DBName:    SQLite,
}

Functions

func New

func New(option SQLStoreOption) store.Store

Types

type DBName

type DBName int
const (
	SQLite DBName = iota
	PostgreSQL
	MySQL
)

func (DBName) String

func (n DBName) String() string

type SQLStore

type SQLStore struct {
	SQLStoreOption
	// contains filtered or unexported fields
}

func (*SQLStore) Get

func (sa *SQLStore) Get(key string) ([]byte, error)

func (*SQLStore) Set

func (sa *SQLStore) Set(key string, val []byte, ttl time.Duration) error

type SQLStoreOption

type SQLStoreOption struct {
	DB        *sql.DB
	Ctx       context.Context
	TableName string
	DBName    DBName
}

Jump to

Keyboard shortcuts

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