storage

package
v0.3.0-alpha7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDBNameNotSpecified = errors.New("db name not specified")
View Source
var ErrDBNotSupported = errors.New("not supported db")
View Source
var ErrIncompleteCertInformationProvided = errors.New("you provided some, but not all certificate information")

Functions

func GetGlobalDB

func GetGlobalDB() *gorm.DB

func LoadDB

func LoadDB(c Config) (*gorm.DB, error)

LoadDB serves as a singleton that initializes the value of db per package

func NewDB

func NewDB(c Config) (*gorm.DB, error)

NewDB creates an instance of database based on config

Types

type Config

type Config struct {
	Use       string
	Prefix    string
	Cockroach struct {
		Host              string
		Port              string
		UserName          string
		Password          string
		ClientCA          string
		ClientSSLKey      string
		ClientSSLCert     string
		Database          string
		ConfigureZones    bool
		DefaultZoneConfig struct {
			GcTtlseconds                    uint64
			BackpressureRangeSizeMultiplier uint64
		}
	}
}

Directories

Path Synopsis
orm

Jump to

Keyboard shortcuts

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