sql

package module
v0.0.0-...-086be9f Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	gorm.Model
	AppName string
	Scope   string
	Value   datatypes.JSON
	Version int64
}

Data represents per-scope data(configs/secrets) which consists of a JSON field

type StorageService

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

StorageService contains a gorm DB client and a container for data loaded from DB into memory

func NewStorageService

func NewStorageService(deploymentID string, cnf *database.Config, encryptor types.Encryptor, logLevel logger.LogLevel) (*StorageService, error)

func (*StorageService) DeleteEntry

func (ss *StorageService) DeleteEntry(appName, scope, name string) error

func (*StorageService) GetCurrentVersion

func (ss *StorageService) GetCurrentVersion(appName, scope string) (int64, error)

func (*StorageService) GetEntries

func (ss *StorageService) GetEntries(appName string, scope string) (map[string]interface{}, error)

func (*StorageService) GetEntry

func (ss *StorageService) GetEntry(appName, scope, name string) (interface{}, error)

func (*StorageService) GetLatestVersion

func (ss *StorageService) GetLatestVersion(appName, scope string) (int64, error)

func (*StorageService) ListAppNames

func (ss *StorageService) ListAppNames() ([]string, error)

func (*StorageService) ListEntries

func (ss *StorageService) ListEntries(appName, scope string) ([]string, error)

func (*StorageService) Read

func (ss *StorageService) Read(appName, scope string) error

func (*StorageService) SetEntries

func (ss *StorageService) SetEntries(appName string, scope string, values map[string]interface{}) error

func (*StorageService) SetEntry

func (ss *StorageService) SetEntry(appName, scope, name string, value interface{}) error

func (*StorageService) Write

func (ss *StorageService) Write(appName, scope string) error

Jump to

Keyboard shortcuts

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