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: 0

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