Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Core
- func (c *Core) GenerateReport() error
- func (c *Core) GetCertificateReport() (string, []byte, error)
- func (c *Core) GetManifestSignature() []byte
- func (c *Core) GetTLSConfig() *tls.Config
- func (c *Core) Initialize(jsonManifest []byte) ([]byte, error)
- func (c *Core) IsRecovering() bool
- func (c *Core) Recover(ctx context.Context, key []byte) error
- func (c *Core) StartDatabase() error
Constants ¶
const ERocksDBMasterKeyVar = "EROCKSDB_MASTERKEY"
ERocksDBMasterKeyVar is the name of the environment variable holding the master key for eRocksDB. Needs to be kept in sync with 3rdparty/edgeless-rocksdb/file/encrypted_file.cc
const EnvAPIAddress = "EDG_EDB_API_ADDR"
EnvAPIAddress is the name of the optional environment variable holding the API address
const EnvCertificateDNSName = "EDG_EDB_CERT_DNS"
EnvCertificateDNSName is the name of the optional environment variable holding the DNS Name used for the certificate generated by edb
const EnvDataPath = "EDG_EDB_DATA_PATH"
EnvDataPath is the name of the optional environment variable holding the data path for edb
const EnvDatabaseAddress = "EDG_EDB_DATABASE_ADDR"
EnvDatabaseAddress is the name of the optional environment variable holding the database address
const EnvDebug = "EDG_EDB_DEBUG"
EnvDebug is a flag to enable debug logging for edb
const EnvLogDir = "EDG_EDB_LOG_DIR"
EnvLogDir is the name of the optional environment variable holding the path for storing the log files
const EnvManifestFile = "EDG_EDB_MANIFEST_FILE"
EnvManifestFile holds the path to the manifest file in case we want edb to automatically deploy one
const PersistenceDir = "edb-persistence"
PersistenceDir holds the directory name where we store the seal key on the host filesystem when running standalone
Variables ¶
var ErrKeyIncorrectSize = errors.New("key is not 16 bytes long")
ErrKeyIncorrectSize is an error type returned when the key used by ERocksDB is not 16 bytes (= 128 bit) long
var ErrKeyNotAllowedToChangeMarblerun = errors.New("cannot change sealing key when running under marblerun")
ErrKeyNotAllowedToChangeMarblerun is an error type thrown when edb attempts to change the sealing key provided by Marblerun
var ErrKeyNotProvidedMarblerun = errors.New("marblerun did not set required key for edb")
ErrKeyNotProvidedMarblerun is an error type thrown when edb was run as a Marble, but Marblerun did not provide a key in the environment
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DataPath string `json:",omitempty"` DatabaseAddress string `json:",omitempty"` APIAddress string `json:",omitempty"` CertificateDNSName string `json:",omitempty"` Debug bool `json:",omitempty"` LogDir string `json:",omitempty"` ManifestFilePath string `json:",omitempty"` }
Config is an EDB config.
func FillConfigFromEnvironment ¶
FillConfigFromEnvironment takes an existing config filled with defaults and replaces single values based on environment variables.
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core implements the core logic of EDB.
func (*Core) GenerateReport ¶ added in v0.3.0
func (*Core) GetCertificateReport ¶
GetCertificateReport gets the certificate and a report that includes the certificate's hash.
func (*Core) GetManifestSignature ¶
GetManifestSignature returns the signature of the manifest that has been used to initialize the database.
func (*Core) GetTLSConfig ¶
GetTLSConfig creates a TLS configuration that includes the certificate.
func (*Core) Initialize ¶
Initialize sets up a database according to the jsonManifest.
func (*Core) IsRecovering ¶
IsRecovering returns if edb (in standalone mode) is in recovery mode, or if it's not.
func (*Core) Recover ¶
Recover sets an encryption key (ideally decrypted from the recovery data) and tries to unseal and load a saved state again.
func (*Core) StartDatabase ¶
StartDatabase starts the database.