2022-09-10 11:39:07 +00:00
|
|
|
// Package database represents a connector to the sqlite storage
|
|
|
|
// backend to store persistent data from core and plugins
|
|
|
|
package database
|
|
|
|
|
|
|
|
import (
|
2022-10-22 22:08:02 +00:00
|
|
|
"gorm.io/gorm"
|
2022-09-10 11:39:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
// Connector represents a database connection having some extra
|
|
|
|
// convenience methods
|
|
|
|
Connector interface {
|
|
|
|
Close() error
|
2022-10-22 22:08:02 +00:00
|
|
|
DB() *gorm.DB
|
2023-02-06 18:40:06 +00:00
|
|
|
DeleteCoreMeta(key string) error
|
2022-09-10 11:39:07 +00:00
|
|
|
ReadCoreMeta(key string, value any) error
|
|
|
|
StoreCoreMeta(key string, value any) error
|
|
|
|
ReadEncryptedCoreMeta(key string, value any) error
|
2023-03-24 18:23:48 +00:00
|
|
|
ResetEncryptedCoreMeta() error
|
2022-09-10 11:39:07 +00:00
|
|
|
StoreEncryptedCoreMeta(key string, value any) error
|
|
|
|
DecryptField(string) (string, error)
|
|
|
|
EncryptField(string) (string, error)
|
2023-03-24 18:23:48 +00:00
|
|
|
ValidateEncryption() error
|
2022-09-10 11:39:07 +00:00
|
|
|
}
|
|
|
|
)
|