Documentation ¶
Index ¶
- Constants
- func NewConsulBackend(conf map[string]string, logger log.Logger) (physical.Backend, error)
- type ConsulBackend
- func (c *ConsulBackend) Delete(key string) error
- func (c *ConsulBackend) DetectHostAddr() (string, error)
- func (c *ConsulBackend) Get(key string) (*physical.Entry, error)
- func (c *ConsulBackend) HAEnabled() bool
- func (c *ConsulBackend) List(prefix string) ([]string, error)
- func (c *ConsulBackend) LockWith(key, value string) (physical.Lock, error)
- func (c *ConsulBackend) NotifyActiveStateChange() error
- func (c *ConsulBackend) NotifySealedStateChange() error
- func (c *ConsulBackend) Put(entry *physical.Entry) error
- func (c *ConsulBackend) RunServiceDiscovery(waitGroup *sync.WaitGroup, shutdownCh physical.ShutdownChannel, ...) (err error)
- func (c *ConsulBackend) Transaction(txns []*physical.TxnEntry) error
- type ConsulLock
Constants ¶
const ( // DefaultServiceName is the default Consul service name used when // advertising a Vault instance. DefaultServiceName = "vault" )
Variables ¶
This section is empty.
Functions ¶
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.
func (*ConsulBackend) Delete ¶
func (c *ConsulBackend) Delete(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) Get ¶
func (c *ConsulBackend) Get(key string) (*physical.Entry, error)
Get is used to fetch an entry
func (*ConsulBackend) HAEnabled ¶
func (c *ConsulBackend) HAEnabled() bool
HAEnabled indicates whether the HA functionality should be exposed. Currently always returns true.
func (*ConsulBackend) List ¶
func (c *ConsulBackend) List(prefix string) ([]string, error)
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)
Lock is used for mutual exclusion based on the given key.
func (*ConsulBackend) NotifyActiveStateChange ¶
func (c *ConsulBackend) NotifyActiveStateChange() error
func (*ConsulBackend) NotifySealedStateChange ¶
func (c *ConsulBackend) NotifySealedStateChange() error
func (*ConsulBackend) Put ¶
func (c *ConsulBackend) Put(entry *physical.Entry) error
Put is used to insert or update an entry
func (*ConsulBackend) RunServiceDiscovery ¶
func (c *ConsulBackend) RunServiceDiscovery(waitGroup *sync.WaitGroup, shutdownCh physical.ShutdownChannel, redirectAddr string, activeFunc physical.ActiveFunction, sealedFunc physical.SealedFunction) (err error)
func (*ConsulBackend) Transaction ¶
func (c *ConsulBackend) Transaction(txns []*physical.TxnEntry) error
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