database

package
v0.0.0-...-7c12fc0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToDatabase

func ConnectToDatabase(logger *slog.Logger, path string) (*sqlx.DB, error)

Types

type BadgerKeyValueStore

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

func NewBadgerKeyValueStore

func NewBadgerKeyValueStore(path string) (*BadgerKeyValueStore, error)

func (*BadgerKeyValueStore) Close

func (b *BadgerKeyValueStore) Close() error

func (*BadgerKeyValueStore) Delete

func (b *BadgerKeyValueStore) Delete(key string) error

func (*BadgerKeyValueStore) Get

func (b *BadgerKeyValueStore) Get(key string) ([]byte, error)

func (*BadgerKeyValueStore) Increment

func (b *BadgerKeyValueStore) Increment(key string) (int, error)

func (*BadgerKeyValueStore) Keys

func (b *BadgerKeyValueStore) Keys(prefix string) ([]string, error)

func (*BadgerKeyValueStore) Set

func (b *BadgerKeyValueStore) Set(key string, value []byte, ttl time.Duration) error

type KeyValueStore

type KeyValueStore interface {
	Close() error

	Get(key string) ([]byte, error)
	Set(key string, value []byte, ttl time.Duration) error
	Increment(key string) (int, error)
	Delete(key string) error
	Keys(prefix string) ([]string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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