Help us shape the future of Go! Take the 2026 Go Developer Survey

entrycache

package
v1.14.9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent added in v0.12.0

type Agent struct {
	// ID is the Agent's SPIFFE ID.
	ID spiffeid.ID
	// Selectors is the Agent's selectors.
	Selectors []*types.Selector
}

Agent represents the association of selectors to an agent SPIFFE ID.

type AgentIterator added in v0.12.0

type AgentIterator interface {
	// Next returns true if there are any remaining agents in the data source and returns false otherwise.
	Next(ctx context.Context) bool
	// Agent returns the next agent from the data source.
	Agent() Agent
	// Err returns an error encountered when attempting to process agents from the data source.
	Err() error
}

AgentIterator is used to iterate through Agent selectors from a data source. The usage pattern of the iterator is as follows:

for it.Next() {
    agent := it.Agent()
    // process agent
}

if it.Err() {
    // handle error
}

type Cache added in v0.12.0

type Cache interface {
	LookupAuthorizedEntries(agentID spiffeid.ID, entries map[string]struct{}) map[string]api.ReadOnlyEntry
	GetAuthorizedEntries(agentID spiffeid.ID) []api.ReadOnlyEntry
}

Cache contains a snapshot of all registration entries and Agent selectors from the data source at a particular moment in time.

type EntryIterator added in v0.12.0

type EntryIterator interface {
	// Next returns true if there are any remaining registration entries in the data source and returns false otherwise.
	Next(ctx context.Context) bool
	// Entry returns the next entry from the data source.
	Entry() *types.Entry
	// Err returns an error encountered when attempting to process entries from the data source.
	Err() error
}

EntryIterator is used to iterate through registration entries from a data source. The usage pattern of the iterator is as follows:

for it.Next() {
    entry := it.Entry()
    // process entry
}

if it.Err() {
    // handle error
}

type FullEntryCache added in v0.12.0

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

func Build added in v0.12.0

func Build(ctx context.Context, trustDomain string, entryIter EntryIterator, agentIter AgentIterator) (*FullEntryCache, error)

Build queries the data source for all registration entries and Agent selectors and builds an in-memory representation of the data that can be used for efficient lookups.

func BuildFromDataStore added in v0.12.0

func BuildFromDataStore(ctx context.Context, trustDomain string, ds datastore.DataStore) (*FullEntryCache, error)

BuildFromDataStore builds a Cache using the provided datastore as the data source

func (*FullEntryCache) GetAuthorizedEntries added in v0.12.0

func (c *FullEntryCache) GetAuthorizedEntries(agentID spiffeid.ID) []api.ReadOnlyEntry

GetAuthorizedEntries gets all authorized registration entries for a given Agent SPIFFE ID.

func (*FullEntryCache) LookupAuthorizedEntries added in v1.12.0

func (c *FullEntryCache) LookupAuthorizedEntries(agentID spiffeid.ID, requestedEntries map[string]struct{}) map[string]api.ReadOnlyEntry

type Selector added in v0.12.0

type Selector struct {
	// Type is the type of the selector.
	Type string
	// Value is the value of the selector.
	Value string
}

Selector is a key-value attribute of a node or workload.

Jump to

Keyboard shortcuts

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