kvstore

package
v1.3.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwaitingReconnectionKey added in v0.10.0

type AwaitingReconnectionKey struct {
	OrgID      uuid.UUID
	DeviceName string
}

func (*AwaitingReconnectionKey) ComposeKey added in v0.10.0

func (a *AwaitingReconnectionKey) ComposeKey() string

type DeviceKey added in v0.10.0

type DeviceKey struct {
	OrgID      uuid.UUID
	DeviceName string
}

func (*DeviceKey) ComposeKey added in v0.10.0

func (d *DeviceKey) ComposeKey() string

type GitContentsKey

type GitContentsKey struct {
	OrgID           uuid.UUID
	Fleet           string
	TemplateVersion string
	Repository      string
	TargetRevision  string
	Path            string
}

func (*GitContentsKey) ComposeKey

func (k *GitContentsKey) ComposeKey() string

type GitRevisionKey

type GitRevisionKey struct {
	OrgID           uuid.UUID
	Fleet           string
	TemplateVersion string
	Repository      string
	TargetRevision  string
}

func (*GitRevisionKey) ComposeKey

func (k *GitRevisionKey) ComposeKey() string

type HttpFingerprintKey added in v1.2.0

type HttpFingerprintKey struct {
	OrgID           uuid.UUID
	Fleet           string
	TemplateVersion string
	URL             string
}

HttpFingerprintKey stores the ETag/Last-Modified fingerprint alongside the cached HTTP body so stale entries can be detected on DependencyChangeDetected without changing the HttpKey format.

func (*HttpFingerprintKey) ComposeKey added in v1.2.0

func (k *HttpFingerprintKey) ComposeKey() string

type HttpKey

type HttpKey struct {
	OrgID           uuid.UUID
	Fleet           string
	TemplateVersion string
	URL             string
}

func (*HttpKey) ComposeKey

func (k *HttpKey) ComposeKey() string

type K8sSecretKey

type K8sSecretKey struct {
	OrgID           uuid.UUID
	Fleet           string
	TemplateVersion string
	Namespace       string
	Name            string
}

func (*K8sSecretKey) ComposeKey

func (k *K8sSecretKey) ComposeKey() string

type KVStore

type KVStore interface {
	Close()
	SetNX(ctx context.Context, key string, value []byte) (bool, error)
	SetIfGreater(ctx context.Context, key string, newVal int64) (bool, error)
	Get(ctx context.Context, key string) ([]byte, error)
	GetOrSetNX(ctx context.Context, key string, value []byte) ([]byte, error)
	DeleteKeysForTemplateVersion(ctx context.Context, key string) error
	DeleteAllKeys(ctx context.Context) error
	PrintAllKeys(ctx context.Context) // For debugging
	// Stream operations for log streaming
	StreamAdd(ctx context.Context, key string, value []byte) (string, error)
	StreamRange(ctx context.Context, key string, start, stop string) ([]StreamEntry, error)
	StreamRead(ctx context.Context, key string, lastID string, block time.Duration, count int64) ([]StreamEntry, error)
	SetExpire(ctx context.Context, key string, expiration time.Duration) error
	Delete(ctx context.Context, key string) error
}

func NewKVStore

func NewKVStore(ctx context.Context, log logrus.FieldLogger, hostname string, port uint, password domain.SecureString) (KVStore, error)

type RepositoryUrlKey

type RepositoryUrlKey struct {
	OrgID           uuid.UUID
	Fleet           string
	TemplateVersion string
	Repository      string
}

func (*RepositoryUrlKey) ComposeKey

func (k *RepositoryUrlKey) ComposeKey() string

type StreamEntry added in v1.1.0

type StreamEntry struct {
	ID    string
	Value []byte
}

StreamEntry represents a single entry in a Redis stream

type TemplateVersionKey

type TemplateVersionKey struct {
	OrgID           uuid.UUID
	Fleet           string
	TemplateVersion string
}

func (*TemplateVersionKey) ComposeKey

func (k *TemplateVersionKey) ComposeKey() string

type VmQuadletFilesKey added in v1.3.0

type VmQuadletFilesKey struct{}

VmQuadletFilesKey is a content-addressed KV key for caching the Quadlet unit files produced by vm-to-quadlet. The key is global (not scoped to org/fleet/templateVersion) because the conversion is deterministic: the same vm.yaml input and render options always produce the same Quadlet files. The cached value is a JSON-encoded map[string]string (filename → content).

func (*VmQuadletFilesKey) ComposeKey added in v1.3.0

func (k *VmQuadletFilesKey) ComposeKey(vmYAML []byte, launcherImage string, passtWorkarounds bool) string

Jump to

Keyboard shortcuts

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