Documentation ¶
Index ¶
- Constants
- type HashicorpVaultStore
- func FromInMemoryStore(ctx context.Context, newStorage *inmemory.InMemStore, ...) (*HashicorpVaultStore, error)
- func FromInMemoryStoreV2(ctx context.Context, newStorage *inmemory.InMemStore, ...) (*HashicorpVaultStore, error)
- func NewHashicorpVaultStore(ctx context.Context, storage logical.Storage, network core.Network) *HashicorpVaultStore
- func (store *HashicorpVaultStore) DeleteAccount(accountID uuid.UUID) error
- func (store *HashicorpVaultStore) ListAccounts() ([]core.ValidatorAccount, error)
- func (store *HashicorpVaultStore) Name() string
- func (store *HashicorpVaultStore) Network() core.Network
- func (store *HashicorpVaultStore) OpenAccount(accountID uuid.UUID) (core.ValidatorAccount, error)
- func (store *HashicorpVaultStore) OpenWallet() (core.Wallet, error)
- func (store *HashicorpVaultStore) RetrieveHighestAttestation(pubKey []byte) (*phase0.AttestationData, error)
- func (store *HashicorpVaultStore) RetrieveHighestProposal(pubKey []byte) (phase0.Slot, error)
- func (store *HashicorpVaultStore) SaveAccount(account core.ValidatorAccount) error
- func (store *HashicorpVaultStore) SaveHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error
- func (store *HashicorpVaultStore) SaveHighestProposal(pubKey []byte, slot phase0.Slot) error
- func (store *HashicorpVaultStore) SaveWallet(wallet core.Wallet) error
- func (store *HashicorpVaultStore) SetEncryptor(encryptor encryptor.Encryptor, password []byte)
Constants ¶
const ( WalletHighestAttestationPath = "highestAttestations/" WalletHighestProposalsBase = "proposals/%s" // account/proposal )
Paths
const ( WalletDataPath = "wallet/data" AccountBase = "wallet/accounts/" AccountPath = AccountBase + "%s" )
Paths
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashicorpVaultStore ¶
type HashicorpVaultStore struct {
// contains filtered or unexported fields
}
HashicorpVaultStore implements store.Store interface using Vault.
func FromInMemoryStore ¶
func FromInMemoryStore(ctx context.Context, newStorage *inmemory.InMemStore, existingStorage logical.Storage) (*HashicorpVaultStore, error)
FromInMemoryStore creates the HashicorpVaultStore based on the given in-memory store.
func FromInMemoryStoreV2 ¶ added in v1.3.8
func FromInMemoryStoreV2(ctx context.Context, newStorage *inmemory.InMemStore, existingStorage logical.Storage) (*HashicorpVaultStore, error)
FromInMemoryStoreV2 updates HashicorpVaultStore with new accounts.
func NewHashicorpVaultStore ¶
func NewHashicorpVaultStore(ctx context.Context, storage logical.Storage, network core.Network) *HashicorpVaultStore
NewHashicorpVaultStore is the constructor of HashicorpVaultStore.
func (*HashicorpVaultStore) DeleteAccount ¶
func (store *HashicorpVaultStore) DeleteAccount(accountID uuid.UUID) error
DeleteAccount deletes the given account
func (*HashicorpVaultStore) ListAccounts ¶
func (store *HashicorpVaultStore) ListAccounts() ([]core.ValidatorAccount, error)
ListAccounts returns an empty array for no accounts
func (*HashicorpVaultStore) Name ¶
func (store *HashicorpVaultStore) Name() string
Name returns the name of the store.
func (*HashicorpVaultStore) Network ¶
func (store *HashicorpVaultStore) Network() core.Network
Network returns the network the storage is related to.
func (*HashicorpVaultStore) OpenAccount ¶
func (store *HashicorpVaultStore) OpenAccount(accountID uuid.UUID) (core.ValidatorAccount, error)
OpenAccount opens an account by the given ID. Returns nil,nil if no account was found.
func (*HashicorpVaultStore) OpenWallet ¶
func (store *HashicorpVaultStore) OpenWallet() (core.Wallet, error)
OpenWallet returns nil,nil if no wallet was found
func (*HashicorpVaultStore) RetrieveHighestAttestation ¶
func (store *HashicorpVaultStore) RetrieveHighestAttestation(pubKey []byte) (*phase0.AttestationData, error)
RetrieveHighestAttestation retrieves highest attestation
func (*HashicorpVaultStore) RetrieveHighestProposal ¶
func (store *HashicorpVaultStore) RetrieveHighestProposal(pubKey []byte) (phase0.Slot, error)
RetrieveHighestProposal implements Storage interface.
func (*HashicorpVaultStore) SaveAccount ¶
func (store *HashicorpVaultStore) SaveAccount(account core.ValidatorAccount) error
SaveAccount stores the given account in DB.
func (*HashicorpVaultStore) SaveHighestAttestation ¶
func (store *HashicorpVaultStore) SaveHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error
SaveHighestAttestation saves highest attestation
func (*HashicorpVaultStore) SaveHighestProposal ¶
func (store *HashicorpVaultStore) SaveHighestProposal(pubKey []byte, slot phase0.Slot) error
SaveHighestProposal implements Storage interface.
func (*HashicorpVaultStore) SaveWallet ¶
func (store *HashicorpVaultStore) SaveWallet(wallet core.Wallet) error
SaveWallet implements Storage interface.
func (*HashicorpVaultStore) SetEncryptor ¶
func (store *HashicorpVaultStore) SetEncryptor(encryptor encryptor.Encryptor, password []byte)
SetEncryptor sets the given encryptor. Could be nil value.