db

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const EnvRootCertificate = "EDB_ROOT_CERT"

EnvRootCertificate is the name of the environment variable holding the root certificate passed by Marblerun (created as a secret)

View Source
const EnvRootKey = "EDB_ROOT_KEY"

EnvRootKey is the name of the environment variable holding the private key for root certificate passed by Marblerun (as a secret)

View Source
const (
	FilenameErrorLog = "mariadb.err" // this one is public as we try to parse it from elsewhere in case MariaDB directly tries to call exit() due to an error
)

Variables

View Source
var ErrNotInitializedYet = errors.New("database has not been initialized yet")

ErrNotInitializedYet is thrown when the database has not been initialized yet

View Source
var ErrPreviousInitFailed = errors.New("a previous initialization attempt failed")

ErrPreviousInitFailed is thrown when a previous initialization attempt failed, but another init or start is attempted.

Functions

This section is empty.

Types

type Database

type Database interface {
	// GetCertificate gets the database certificate.
	GetCertificate() ([]byte, crypto.PrivateKey)
	// Initialize sets up a database according to the jsonManifest.
	Initialize(jsonManifest []byte) error
	// Start starts the database.
	Start() error
	// GetManifestSignature returns the signature of the manifest that has been used to initialize the database.
	GetManifestSignature() []byte
}

Database is a secure database that can be initialized by a manifest.

type DatabaseMock

type DatabaseMock struct {
	Man manifest
}

DatabaseMock is a Database mock.

func (*DatabaseMock) GetCertificate

func (d *DatabaseMock) GetCertificate() ([]byte, crypto.PrivateKey)

GetCertificate gets the database certificate.

func (*DatabaseMock) GetManifestSignature

func (d *DatabaseMock) GetManifestSignature() []byte

GetManifestSignature returns the signature of the manifest that has been used to initialize the database.

func (*DatabaseMock) Initialize

func (d *DatabaseMock) Initialize(jsonManifest []byte) error

Initialize sets up a database according to the jsonManifest.

func (*DatabaseMock) Start

func (d *DatabaseMock) Start() error

Start starts the database.

type Mariadb

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

Mariadb is a secure database based on MariaDB.

func NewMariadb

func NewMariadb(internalPath, externalPath, internalAddress, externalAddress, certificateDNSName, logDir string, debug bool, isMarble bool, mariadbd Mariadbd, maxPoolThreads int) (*Mariadb, error)

NewMariadb creates a new Mariadb object.

func (*Mariadb) GetCertificate

func (d *Mariadb) GetCertificate() ([]byte, crypto.PrivateKey)

GetCertificate gets the database certificate.

func (*Mariadb) GetManifestSignature

func (d *Mariadb) GetManifestSignature() []byte

GetManifestSignature returns the signature of the manifest that has been used to initialize the database.

func (*Mariadb) Initialize

func (d *Mariadb) Initialize(jsonManifest []byte) error

Initialize sets up a database according to the jsonManifest.

func (*Mariadb) Start

func (d *Mariadb) Start() error

Start starts the database.

type Mariadbd

type Mariadbd interface {
	Main(cnfPath string) int
	WaitUntilStarted()
	WaitUntilListenInternalReady()
}

Mariadbd is used to control mariadbd.

Jump to

Keyboard shortcuts

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