-
Notifications
You must be signed in to change notification settings - Fork 9
/
key_vault_options.go
38 lines (32 loc) · 1.13 KB
/
key_vault_options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package eth2keymanager
import (
"github.com/ssvlabs/eth2-key-manager/core"
encryptor2 "github.com/ssvlabs/eth2-key-manager/encryptor"
)
// KeyVaultOptions contains options to create a new key vault object
type KeyVaultOptions struct {
encryptor encryptor2.Encryptor
password []byte
storage interface{} // a generic interface as there are a few core storage interfaces (storage, slashing storage and so on)
walletType core.WalletType
}
// SetEncryptor is the encryptor setter
func (options *KeyVaultOptions) SetEncryptor(encryptor encryptor2.Encryptor) *KeyVaultOptions {
options.encryptor = encryptor
return options
}
// SetStorage is the storage setter
func (options *KeyVaultOptions) SetStorage(storage interface{}) *KeyVaultOptions {
options.storage = storage
return options
}
// SetPassword is the password setter
func (options *KeyVaultOptions) SetPassword(password string) *KeyVaultOptions {
options.password = []byte(password)
return options
}
// SetWalletType is the wallet type setter
func (options *KeyVaultOptions) SetWalletType(walletType core.WalletType) *KeyVaultOptions {
options.walletType = walletType
return options
}