database

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package database represents a connector to the sqlite storage backend to store persistent data from core and plugins

Index

Constants

This section is empty.

Variables

View Source
var ErrCoreMetaNotFound = errors.New("core meta entry not found")

ErrCoreMetaNotFound is the error thrown when reading a non-existent core_kv key

Functions

This section is empty.

Types

type Connector

type Connector interface {
	Close() error
	DB() *gorm.DB
	ReadCoreMeta(key string, value any) error
	StoreCoreMeta(key string, value any) error
	ReadEncryptedCoreMeta(key string, value any) error
	StoreEncryptedCoreMeta(key string, value any) error
	DecryptField(string) (string, error)
	EncryptField(string) (string, error)
}

Connector represents a database connection having some extra convenience methods

func GetTestDatabase

func GetTestDatabase(t *testing.T) Connector

func New

func New(driverName, connString, encryptionSecret string) (Connector, error)

New creates a new Connector with the given driver and database

Jump to

Keyboard shortcuts

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