annotationstore

package
v0.91.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 1 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 AnnotationLevel

type AnnotationLevel string

AnnotationLevel identifies which proposal-analysis level to read annotations from.

const (
	// AnnotationLevelProposal reads proposal-level annotations.
	AnnotationLevelProposal AnnotationLevel = "proposal"
	// AnnotationLevelBatchOperation reads batch-operation-level annotations.
	AnnotationLevelBatchOperation AnnotationLevel = "batch_operation"
	// AnnotationLevelCall reads call-level annotations.
	AnnotationLevelCall AnnotationLevel = "call"
	// AnnotationLevelParameter reads parameter-level annotations.
	AnnotationLevelParameter AnnotationLevel = "parameter"
)

type DependencyAnnotationPredicate

type DependencyAnnotationPredicate func(level AnnotationLevel, ann annotation.Annotation) bool

DependencyAnnotationPredicate is a function that tests whether a dependency annotation matches a condition in the context of its analysis level.

func ByAnalyzer

func ByAnalyzer(analyzerID string) DependencyAnnotationPredicate

ByAnalyzer returns a predicate that matches annotations produced by the given analyzer ID.

func ByLevel

ByLevel returns a predicate that matches annotations at the given level.

func ByName

ByName returns a predicate that matches annotations with the given name.

func ByType

ByType returns a predicate that matches annotations with the given type.

type DependencyAnnotationStore

type DependencyAnnotationStore interface {
	// DependencyAnnotations returns all annotations available to the current entity.
	DependencyAnnotations() annotation.Annotations

	// Filter returns dependency annotations matching every provided predicate.
	// Predicates can be composed using:
	//   - ByLevel
	//   - ByName
	//   - ByType
	//   - ByAnalyzer
	Filter(preds ...DependencyAnnotationPredicate) annotation.Annotations
}

DependencyAnnotationStore exposes dependency-scoped annotations for an analyzer.

Implementations MUST enforce that reads are limited to the current analyzer's declared Dependencies().

func NewScopedDependencyAnnotationStore

func NewScopedDependencyAnnotationStore(
	dependencyAnalyzerIDs []string,
	annotationsByLevel map[AnnotationLevel]annotation.Annotations,
) DependencyAnnotationStore

NewScopedDependencyAnnotationStore creates a dependency-scoped annotation store for a single analyzer execution.

The returned store includes only annotations emitted by the analyzers listed in dependencyAnalyzerIDs and supports level-aware filtering.

Jump to

Keyboard shortcuts

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