Documentation ¶
Index ¶
Constants ¶
const EnvRootCertificate = "EDB_ROOT_CERT"
EnvRootCertificate is the name of the environment variable holding the root certificate passed by Marblerun (created as a secret)
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)
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 ¶
var ErrNotInitializedYet = errors.New("database has not been initialized yet")
ErrNotInitializedYet is thrown when the database has not been initialized yet
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.
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 ¶
GetManifestSignature returns the signature of the manifest that has been used to initialize the database.
func (*Mariadb) Initialize ¶
Initialize sets up a database according to the jsonManifest.