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) 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.
Click to show internal directories.
Click to hide internal directories.