20 lines
356 B
Go
20 lines
356 B
Go
package vault
|
|
|
|
import (
|
|
"github.com/hashicorp/hcl/v2"
|
|
)
|
|
|
|
type VaultGetter interface {
|
|
GetValue(entryKey string) ([]byte, error)
|
|
}
|
|
|
|
type MockGetter []byte
|
|
|
|
func (m MockGetter) GetValue(string) ([]byte, error) {
|
|
return m, nil
|
|
}
|
|
|
|
func RegisterInContext(evalCtx *hcl.EvalContext, getter VaultGetter) {
|
|
evalCtx.Functions["from_vault"] = FromVault(getter)
|
|
}
|