data

package
v0.0.0-...-ec4f49e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProjectEverything = &KeySummaryProjection{HasKey: true, HasValue: true}

Functions

func GetValue

func GetValue(filename string, key string, version int64) ([]byte, error)

GetValue scans the bucket of the bolt db file for a etcd v3 record with the given key and returns the value. Because bolt db files are indexed by revision

func ListVersions

func ListVersions(filename string, key string) ([]int64, error)

ListVersions lists all versions of a object with the given key.

Types

type Checksum

type Checksum struct {
	Hash            uint32
	Revision        int64
	CompactRevision int64
}

func HashByRevision

func HashByRevision(filename string, revision int64) (Checksum, error)

HashByRevision returns the checksum and revision. The checksum is of the live keyspace at a particular revision. It is equivalent to performing a range request of all key-value pairs can computing a hash of the data. If revision is 0, the latest revision is checksumed, else revision is checksumed. The resulting hash is consistent particular revision in the presence of compactions; so long as the revions itself has not been compacted, the hash never changes.

type ConstraintOp

type ConstraintOp int
const (
	Equals ConstraintOp = iota
)

func (ConstraintOp) String

func (co ConstraintOp) String() string

type FieldConstraint

type FieldConstraint struct {
	// contains filtered or unexported fields
}

func (*FieldConstraint) BuildFilter

func (fc *FieldConstraint) BuildFilter() (*FieldFilter, error)

func (*FieldConstraint) String

func (fc *FieldConstraint) String() string

type FieldFilter

type FieldFilter struct {
	*FieldConstraint
	// contains filtered or unexported fields
}

FieldFilter filters according to a field constraint.

func (*FieldFilter) Accept

func (ff *FieldFilter) Accept(ks *KeySummary) (bool, error)

type Filter

type Filter interface {
	Accept(ks *KeySummary) (bool, error)
}

Filter declares an interface for filtering KeySummary results.

func ParseFilters

func ParseFilters(filters string) ([]Filter, error)

ParseFilters parses a comma separated list of '<field>=<value>' filters where each field is specified in golang template format, e.g. '.Value.metadata.namespace'.

type KeySummary

type KeySummary struct {
	Key      string
	Version  int64
	Value    interface{}
	TypeMeta *runtime.TypeMeta
	Stats    *KeySummaryStats
}

KeySummary represents a kubernetes object stored in etcd.

func ListKeySummaries

func ListKeySummaries(filename string, filters []Filter, proj *KeySummaryProjection, revision int64) ([]*KeySummary, error)

ListKeySummaries returns a result set with all the provided filters and projections applied.

func (*KeySummary) ValueJson

func (ks *KeySummary) ValueJson() string

ValueJson gets the json representation of a kubernetes object stored in etcd.

type KeySummaryProjection

type KeySummaryProjection struct {
	HasKey   bool
	HasValue bool
}

KeySummaryProjection declares which optional fields to include in KeySummary results.

type KeySummaryStats

type KeySummaryStats struct {
	VersionCount         int
	KeySize              int
	ValueSize            int
	AllVersionsKeySize   int
	AllVersionsValueSize int
}

KeySummaryStats provides high level statistics on a a particular kubernetes object stored in etcd.

type PrefixFilter

type PrefixFilter struct {
	// contains filtered or unexported fields
}

PrefixFilter filter by key prefix.

func NewPrefixFilter

func NewPrefixFilter(prefix string) *PrefixFilter

func (*PrefixFilter) Accept

func (ff *PrefixFilter) Accept(ks *KeySummary) (bool, error)

Jump to

Keyboard shortcuts

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