import "github.com/hashicorp/vault/physical/spanner"
const ( // LockRenewInterval is the time to wait between lock renewals. LockRenewInterval = 5 * time.Second // LockRetryInterval is the amount of time to wait if the lock fails before // trying again. LockRetryInterval = 5 * time.Second // LockTTL is the default lock TTL. LockTTL = 15 * time.Second // LockWatchRetryInterval is the amount of time to wait if a watch fails // before trying again. LockWatchRetryInterval = 5 * time.Second // LockWatchRetryMax is the number of times to retry a failed watch before // signaling that leadership is lost. LockWatchRetryMax = 5 )
NewBackend creates a new Google Spanner storage backend with the given configuration. This uses the official Golang Cloud SDK and therefore supports specifying credentials via envvars, credential files, etc.
type Backend struct {
// contains filtered or unexported fields
}
Backend implements physical.Backend and describes the steps necessary to persist data using Google Cloud Spanner.
Delete deletes an entry with the given key.
Get fetches an entry. If there is no entry, this function returns nil.
HAEnabled implements HABackend and indicates that this backend supports high availability.
List enumerates all keys with the given prefix.
LockWith acquires a mutual exclusion based on the given key.
Put creates or updates an entry.
Transaction runs multiple entries via a single transaction.
type Lock struct {
// contains filtered or unexported fields
}
Lock is the HA lock.
Lock acquires the given lock. The stopCh is optional. If closed, it interrupts the lock acquisition attempt. The returned channel should be closed when leadership is lost.
Unlock releases the lock.
Value returns the value of the lock and if it is held.
LockRecord is the struct that corresponds to a lock.
Package spanner imports 20 packages (graph) and is imported by 6 packages. Updated 2020-09-03. Refresh now. Tools for package owners.