kv

package
v1.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package kv is a generated protocol buffer package.

It is generated from these files:

types.proto

It has these top-level messages:

Configuration
VersionMetadata
KeyMetadata
Version
UpgradeInfo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

Factory will return a logical backend of type versionedKVBackend or PassthroughBackend based on the config passed in.

func LeaseSwitchedPassthroughBackend

func LeaseSwitchedPassthroughBackend(ctx context.Context, conf *logical.BackendConfig, leases bool) (logical.Backend, error)

LeaseSwitchedPassthroughBackend returns a PassthroughBackend with leases switched on or off

func LeasedPassthroughBackendFactory

func LeasedPassthroughBackendFactory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

LeasedPassthroughBackendFactory returns a PassthroughBackend with leases switched on

func PassthroughBackendFactory

func PassthroughBackendFactory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

PassthroughBackendFactory returns a PassthroughBackend with leases switched off

func VersionedKVFactory

func VersionedKVFactory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

Factory returns a new backend as logical.Backend.

Types

type Configuration

type Configuration struct {
	MaxVersions uint32 `protobuf:"varint,1,opt,name=max_versions,json=maxVersions" json:"max_versions,omitempty"`
	CasRequired bool   `protobuf:"varint,2,opt,name=cas_required,json=casRequired" json:"cas_required,omitempty"`
}

func (*Configuration) Descriptor

func (*Configuration) Descriptor() ([]byte, []int)

func (*Configuration) GetCasRequired

func (m *Configuration) GetCasRequired() bool

func (*Configuration) GetMaxVersions

func (m *Configuration) GetMaxVersions() uint32

func (*Configuration) ProtoMessage

func (*Configuration) ProtoMessage()

func (*Configuration) Reset

func (m *Configuration) Reset()

func (*Configuration) String

func (m *Configuration) String() string

type KeyMetadata

type KeyMetadata struct {
	// Key is the key for this entry
	Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	// Versions is the map of versionID -> VersionMetadata.
	// Useful when listing all versions.
	Versions map[uint64]*VersionMetadata `` /* 137-byte string literal not displayed */
	// CurrentVersion is the latest version of the value
	CurrentVersion uint64 `protobuf:"varint,3,opt,name=current_version,json=currentVersion" json:"current_version,omitempty"`
	// OldestVersion is the oldest version of the value.
	OldestVersion uint64 `protobuf:"varint,4,opt,name=oldest_version,json=oldestVersion" json:"oldest_version,omitempty"`
	// Created time is when the metadata was created.
	CreatedTime *google_protobuf.Timestamp `protobuf:"bytes,5,opt,name=created_time,json=createdTime" json:"created_time,omitempty"`
	// Updated time was the last time the metadata version
	// was updated.
	UpdatedTime *google_protobuf.Timestamp `protobuf:"bytes,6,opt,name=updated_time,json=updatedTime" json:"updated_time,omitempty"`
	// MaxVersions specifies how many versions to keep around.
	// If empty value, defaults to the configured Max
	// for the mount.
	MaxVersions uint32 `protobuf:"varint,7,opt,name=max_versions,json=maxVersions" json:"max_versions,omitempty"`
	// CasRequired specifies if the cas parameter is
	// required for this key
	CasRequired bool `protobuf:"varint,8,opt,name=cas_required,json=casRequired" json:"cas_required,omitempty"`
}

func (*KeyMetadata) AddVersion

func (k *KeyMetadata) AddVersion(createdTime, deletionTime *timestamp.Timestamp, configMaxVersions uint32) (*VersionMetadata, uint64)

AddVersion adds a version to the key metadata and moves the sliding window of max versions. It returns the newly added version and the version to delete from storage.

func (*KeyMetadata) Descriptor

func (*KeyMetadata) Descriptor() ([]byte, []int)

func (*KeyMetadata) GetCasRequired

func (m *KeyMetadata) GetCasRequired() bool

func (*KeyMetadata) GetCreatedTime

func (m *KeyMetadata) GetCreatedTime() *google_protobuf.Timestamp

func (*KeyMetadata) GetCurrentVersion

func (m *KeyMetadata) GetCurrentVersion() uint64

func (*KeyMetadata) GetKey

func (m *KeyMetadata) GetKey() string

func (*KeyMetadata) GetMaxVersions

func (m *KeyMetadata) GetMaxVersions() uint32

func (*KeyMetadata) GetOldestVersion

func (m *KeyMetadata) GetOldestVersion() uint64

func (*KeyMetadata) GetUpdatedTime

func (m *KeyMetadata) GetUpdatedTime() *google_protobuf.Timestamp

func (*KeyMetadata) GetVersions

func (m *KeyMetadata) GetVersions() map[uint64]*VersionMetadata

func (*KeyMetadata) ProtoMessage

func (*KeyMetadata) ProtoMessage()

func (*KeyMetadata) Reset

func (m *KeyMetadata) Reset()

func (*KeyMetadata) String

func (m *KeyMetadata) String() string

type Passthrough

type Passthrough interface {
	// contains filtered or unexported methods
}

type PassthroughBackend

type PassthroughBackend struct {
	*framework.Backend
	// contains filtered or unexported fields
}

PassthroughBackend is used storing secrets directly into the physical backend. The secrets are encrypted in the durable storage and custom TTL information can be specified, but otherwise this backend doesn't do anything fancy.

func (*PassthroughBackend) GeneratesLeases

func (b *PassthroughBackend) GeneratesLeases() bool

type UpgradeInfo

type UpgradeInfo struct {
	// Started time is when the upgrade was started.
	StartedTime *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=started_time,json=startedTime" json:"started_time,omitempty"`
	// done is set to true once the backend has been successfully
	// upgraded.
	Done bool `protobuf:"varint,2,opt,name=done" json:"done,omitempty"`
}

func (*UpgradeInfo) Descriptor

func (*UpgradeInfo) Descriptor() ([]byte, []int)

func (*UpgradeInfo) GetDone

func (m *UpgradeInfo) GetDone() bool

func (*UpgradeInfo) GetStartedTime

func (m *UpgradeInfo) GetStartedTime() *google_protobuf.Timestamp

func (*UpgradeInfo) ProtoMessage

func (*UpgradeInfo) ProtoMessage()

func (*UpgradeInfo) Reset

func (m *UpgradeInfo) Reset()

func (*UpgradeInfo) String

func (m *UpgradeInfo) String() string

type Version

type Version struct {
	// Data is a JSON object with string keys that
	// represents the user supplied data.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// CreatedTime is when the version was created.
	CreatedTime *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=created_time,json=createdTime" json:"created_time,omitempty"`
	// DeletionTime is the time this version becomes invalid.
	// Set to Now() to delete the version before the configured
	// deletion time.
	DeletionTime *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=deletion_time,json=deletionTime" json:"deletion_time,omitempty"`
}

func (*Version) Descriptor

func (*Version) Descriptor() ([]byte, []int)

func (*Version) GetCreatedTime

func (m *Version) GetCreatedTime() *google_protobuf.Timestamp

func (*Version) GetData

func (m *Version) GetData() []byte

func (*Version) GetDeletionTime

func (m *Version) GetDeletionTime() *google_protobuf.Timestamp

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) Reset

func (m *Version) Reset()

func (*Version) String

func (m *Version) String() string

type VersionMetadata

type VersionMetadata struct {
	// CreatedTime is when the version was created.
	CreatedTime *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=created_time,json=createdTime" json:"created_time,omitempty"`
	// DeletionTime is the time this version becomes invalid.
	// Set to Now() to delete the version before the configured
	// delete time.
	DeletionTime *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=deletion_time,json=deletionTime" json:"deletion_time,omitempty"`
	// Destroyed is used to specify this version is
	// a has been removed and the underlying data deleted.
	Destroyed bool `protobuf:"varint,3,opt,name=destroyed" json:"destroyed,omitempty"`
}

func (*VersionMetadata) Descriptor

func (*VersionMetadata) Descriptor() ([]byte, []int)

func (*VersionMetadata) GetCreatedTime

func (m *VersionMetadata) GetCreatedTime() *google_protobuf.Timestamp

func (*VersionMetadata) GetDeletionTime

func (m *VersionMetadata) GetDeletionTime() *google_protobuf.Timestamp

func (*VersionMetadata) GetDestroyed

func (m *VersionMetadata) GetDestroyed() bool

func (*VersionMetadata) ProtoMessage

func (*VersionMetadata) ProtoMessage()

func (*VersionMetadata) Reset

func (m *VersionMetadata) Reset()

func (*VersionMetadata) String

func (m *VersionMetadata) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL