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

annotationstore

package
v0.109.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 1 Imported by: 0

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