annotation

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 2 Imported by: ? modules, 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

Overview

Package annotation provides protocol annotation system (@deprecated, @since, etc).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Type  string `json:"type"`  // "deprecated", "since", "see", "experimental", "custom"
	Field string `json:"field"` // field name, or "" for protocol-level
	Value string `json:"value"`
}

Annotation represents a protocol annotation.

type AnnotationSet

type AnnotationSet struct {
	Protocol    string       `json:"protocol"`
	Annotations []Annotation `json:"annotations"`
}

AnnotationSet holds annotations for a protocol.

func NewAnnotationSet

func NewAnnotationSet(protocol string) *AnnotationSet

NewAnnotationSet creates a new annotation set.

func (*AnnotationSet) Add

func (as *AnnotationSet) Add(a Annotation)

Add adds an annotation.

func (*AnnotationSet) ByField

func (as *AnnotationSet) ByField(field string) []Annotation

ByField returns annotations for a specific field.

func (*AnnotationSet) ByType

func (as *AnnotationSet) ByType(t string) []Annotation

ByType returns annotations filtered by type.

func (*AnnotationSet) Deprecated

func (as *AnnotationSet) Deprecated() []Annotation

Deprecated returns all deprecated annotations.

func (*AnnotationSet) Format

func (as *AnnotationSet) Format() string

Format formats annotations for display.

func (*AnnotationSet) Stats

func (as *AnnotationSet) Stats() map[string]int

Stats returns annotation statistics.

Jump to

Keyboard shortcuts

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