databroker: add encryption for records (#1168)

This commit is contained in:
Caleb Doxsey 2020-07-30 14:04:31 -06:00 committed by GitHub
parent 8cae3f27bb
commit 29fb96a955
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 332 additions and 7 deletions

View file

@ -15,6 +15,7 @@ var (
type serverConfig struct {
deletePermanentlyAfter time.Duration
btreeDegree int
secret []byte
storageType string
storageConnectionString string
}
@ -49,6 +50,13 @@ func WithDeletePermanentlyAfter(dur time.Duration) ServerOption {
}
}
// WithSecret sets the secret in the config.
func WithSecret(secret []byte) ServerOption {
return func(cfg *serverConfig) {
cfg.secret = secret
}
}
// WithStorageType sets the storage type.
func WithStorageType(typ string) ServerOption {
return func(cfg *serverConfig) {