Documentation ¶
Index ¶
- Variables
- func DurationMinusBuffer(intv time.Duration, buffer time.Duration, jitter int64) time.Duration
- func DurationMinusBufferDomain(intv time.Duration, buffer time.Duration, jitter int64) (min time.Duration, max time.Duration)
- func NewConsulBackend(conf map[string]string, logger log.Logger) (physical.Backend, error)
- func RandomStagger(intv time.Duration) time.Duration
- func SetupSecureTLS(ctx context.Context, consulConf *api.Config, conf map[string]string, ...) error
- type ConsulBackend
- func (c *ConsulBackend) Delete(ctx context.Context, key string) error
- func (c *ConsulBackend) DetectHostAddr() (string, error)
- func (c *ConsulBackend) ExpandedCapabilitiesAvailable(ctx context.Context) bool
- func (c *ConsulBackend) FailGetInTxn(fail bool)
- func (c *ConsulBackend) Get(ctx context.Context, key string) (*physical.Entry, error)
- func (c *ConsulBackend) HAEnabled() bool
- func (c *ConsulBackend) List(ctx context.Context, prefix string) ([]string, error)
- func (c *ConsulBackend) LockWith(key, value string) (physical.Lock, error)
- func (c *ConsulBackend) Put(ctx context.Context, entry *physical.Entry) error
- func (c *ConsulBackend) Transaction(ctx context.Context, txns []*physical.TxnEntry) error
- type ConsulLock
Constants ¶
This section is empty.
Variables ¶
var (
GetInTxnDisabledError = errors.New("get operations inside transactions are disabled in consul backend")
)
Verify ConsulBackend satisfies the correct interfaces
Functions ¶
func DurationMinusBuffer ¶ added in v1.2.0
DurationMinusBuffer returns a duration, minus a buffer and jitter subtracted from the duration. This function is used primarily for servicing Consul TTL Checks in advance of the TTL.
func DurationMinusBufferDomain ¶ added in v1.2.0
func DurationMinusBufferDomain(intv time.Duration, buffer time.Duration, jitter int64) (min time.Duration, max time.Duration)
DurationMinusBufferDomain returns the domain of valid durations from a call to DurationMinusBuffer. This function is used to check user specified input values to DurationMinusBuffer.
func NewConsulBackend ¶
NewConsulBackend constructs a Consul backend using the given API client and the prefix in the KV store.
func RandomStagger ¶ added in v1.2.0
RandomStagger returns an interval between 0 and the duration
Types ¶
type ConsulBackend ¶
type ConsulBackend struct {
// contains filtered or unexported fields
}
ConsulBackend is a physical backend that stores data at specific prefix within Consul. It is used for most production situations as it allows Vault to run on multiple machines in a highly-available manner. failGetInTxn is only used in tests.
func (*ConsulBackend) Delete ¶
func (c *ConsulBackend) Delete(ctx context.Context, key string) error
Delete is used to permanently delete an entry
func (*ConsulBackend) DetectHostAddr ¶
func (c *ConsulBackend) DetectHostAddr() (string, error)
DetectHostAddr is used to detect the host address by asking the Consul agent
func (*ConsulBackend) ExpandedCapabilitiesAvailable ¶ added in v1.13.0
func (c *ConsulBackend) ExpandedCapabilitiesAvailable(ctx context.Context) bool
ExpandedCapabilitiesAvailable tests to see if Consul has KVGetOrEmpty and 128 entries per transaction available
func (*ConsulBackend) FailGetInTxn ¶ added in v1.13.0
func (c *ConsulBackend) FailGetInTxn(fail bool)
func (*ConsulBackend) HAEnabled ¶
func (c *ConsulBackend) HAEnabled() bool
HAEnabled indicates whether the HA functionality should be exposed. Currently always returns true.
func (*ConsulBackend) List ¶
List is used to list all the keys under a given prefix, up to the next prefix.
func (*ConsulBackend) LockWith ¶
func (c *ConsulBackend) LockWith(key, value string) (physical.Lock, error)
LockWith is used for mutual exclusion based on the given key.
func (*ConsulBackend) Transaction ¶
Transaction is used to run multiple entries via a transaction.
type ConsulLock ¶
type ConsulLock struct {
// contains filtered or unexported fields
}
ConsulLock is used to provide the Lock interface backed by Consul
func (*ConsulLock) Lock ¶
func (c *ConsulLock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error)
func (*ConsulLock) Unlock ¶
func (c *ConsulLock) Unlock() error