linkinfo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompositeSource

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

CompositeSource is a Source that aggregates multiple underlying Sources. It queries each Source in order and returns the first successful result.

func NewCompositeSource

func NewCompositeSource(sources ...Source) *CompositeSource

NewCompositeSource creates a new composite source for link information with the given underlying Sources.

func (s *CompositeSource) LookupLink(
	ctx context.Context,
	typeA string,
	typeB string,
) (*LinkInfo, bool, error)

type LinkInfo

type LinkInfo struct {
	ResourceTypeA         string
	ResourceTypeB         string
	AnnotationDefinitions map[string]*provider.LinkAnnotationDefinition
	CardinalityA          provider.LinkCardinality
	CardinalityB          provider.LinkCardinality
	Origin                LinkInfoOrigin
}

type LinkInfoOrigin

type LinkInfoOrigin string

LinkInfoOrigin indicates where the link info was sourced from, which can be used for telemetry and debugging purposes.

const (
	// LinkInfoOriginProvider indicates that the link info was sourced from a concrete provider plugin.
	LinkInfoOriginProvider LinkInfoOrigin = "provider"
	// LinkInfoOriginTransformer indicates that the link info was sourced from an abstract transformer plugin.
	LinkInfoOriginTransformer LinkInfoOrigin = "transformer"
)

type ProviderSource

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

ProviderSource is a Source that retrieves link info from provider plugins.

func NewProviderSource

func NewProviderSource(linkRegistry provider.LinkRegistry) *ProviderSource

NewProviderSource creates a new ProviderSource with the given provider.LinkRegistry. This source will cache link info in memory to avoid redundant calls to the provider plugin for the same link.

func (s *ProviderSource) LookupLink(
	ctx context.Context,
	typeA string,
	typeB string,
) (*LinkInfo, bool, error)

type Source

type Source interface {
	// LookupLink finds link info for (typeA, typeB). Returns ok=false if no
	// link exists in this source in either direction.
	LookupLink(
		ctx context.Context,
		typeA string,
		typeB string,
	) (*LinkInfo, bool, error)
}

Source exposes cardinality information and annotation definitions for a pair of linked resource types that supports both concrete provider and abstract transformer links.

type TransformerSource

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

TransformerSource is a Source that retrieves link info from transformer plugins.

func NewTransformerSource

func NewTransformerSource(transformers map[string]transform.SpecTransformer) *TransformerSource

NewTransformerSource creates a new TransformerSource with the given map of transformers. This source will cache link info in memory to avoid redundant calls to the transformer plugin for the same link.

func (s *TransformerSource) LookupLink(
	ctx context.Context,
	typeA string,
	typeB string,
) (*LinkInfo, bool, error)

Jump to

Keyboard shortcuts

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