registry

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: AGPL-3.0 Imports: 3 Imported by: 1 module, 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 MemoryStore

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

MemoryStore is the in-memory implementation of Store. Uses a two-level map: entryKey → ResourceEntry for O(1) lookups, plus a connection index for O(entries-in-connection) bulk deletes.

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) Delete

func (s *MemoryStore) Delete(pluginID, connectionID, resourceKey, namespace, id string) (*ResourceEntry, bool)

func (*MemoryStore) DeleteByConnection

func (s *MemoryStore) DeleteByConnection(pluginID, connectionID string) []ResourceEntry

func (*MemoryStore) Get

func (s *MemoryStore) Get(pluginID, connectionID, resourceKey, namespace, id string) (*ResourceEntry, bool)

func (*MemoryStore) Put

func (s *MemoryStore) Put(entry ResourceEntry) (*ResourceEntry, bool)

func (*MemoryStore) PutIfAbsent

func (s *MemoryStore) PutIfAbsent(entry ResourceEntry) (*ResourceEntry, bool)

func (*MemoryStore) ScanByLabel

func (s *MemoryStore) ScanByLabel(
	pluginID, connectionID, resourceKey string,
	selector map[string]string,
) []ResourceEntry

func (*MemoryStore) ScanByResourceKey

func (s *MemoryStore) ScanByResourceKey(pluginID, connectionID, resourceKey string) []ResourceEntry

type ResourceEntry

type ResourceEntry struct {
	PluginID     string
	ConnectionID string
	ResourceKey  string            // e.g. "core::v1::Pod", "ec2::Instance"
	ID           string            // resource name/identifier
	Namespace    string            // scope within connection (empty if unscoped)
	UID          string            // dedup key
	Labels       map[string]string // for selector-based relationship resolution
	CreatedAt    time.Time
}

ResourceEntry is the lightweight metadata the engine stores per resource.

func (ResourceEntry) EntryKey

func (e ResourceEntry) EntryKey() string

EntryKey returns the unique key for this entry within the registry. Format: "pluginID/connectionID/resourceKey/namespace/id".

type Store added in v0.4.0

type Store interface {
	Put(entry ResourceEntry) (old *ResourceEntry, existed bool)
	// PutIfAbsent inserts the entry only if no entry with the same key exists.
	// Returns the existing entry and true if one was already present.
	PutIfAbsent(entry ResourceEntry) (existing *ResourceEntry, loaded bool)
	Get(pluginID, connectionID, resourceKey, namespace, id string) (*ResourceEntry, bool)
	Delete(pluginID, connectionID, resourceKey, namespace, id string) (*ResourceEntry, bool)
	DeleteByConnection(pluginID, connectionID string) []ResourceEntry
	ScanByLabel(pluginID, connectionID, resourceKey string, selector map[string]string) []ResourceEntry
	ScanByResourceKey(pluginID, connectionID, resourceKey string) []ResourceEntry
}

Store abstracts the storage backend for resource entries.

Jump to

Keyboard shortcuts

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