annotations

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropertyName            = "name"
	PropertySecurityScopes  = "scopes"
	PropertyValidatorString = "validate"
)
View Source
const (
	AttributeTag              = "Tag"
	AttributeQuery            = "Query"
	AttributePath             = "Path"
	AttributeBody             = "Body"
	AttributeHeader           = "Header"
	AttributeDeprecated       = "Deprecated"
	AttributeHidden           = "Hidden"
	AttributeSecurity         = "Security"
	AttributeAdvancedSecurity = "AdvancedSecurity"
	AttributeRoute            = "Route"
	AttributeResponse         = "Response"
	AttributeDescription      = "Description"
	AttributeMethod           = "Method"
	AttributeErrorResponse    = "ErrorResponse"
)

Variables

This section is empty.

Functions

func GetCastProperty

func GetCastProperty[TPropertyType any](attrib *Attribute, property string) (*TPropertyType, error)

Types

type AnnotationHolder

type AnnotationHolder struct {
	// contains filtered or unexported fields
}

func NewAnnotationHolder

func NewAnnotationHolder(comments []string) (AnnotationHolder, error)

func (AnnotationHolder) FindFirstByProperty

func (holder AnnotationHolder) FindFirstByProperty(key string, value string) *Attribute

func (AnnotationHolder) FindFirstByValue

func (holder AnnotationHolder) FindFirstByValue(value string) *Attribute

func (AnnotationHolder) GetAll

func (holder AnnotationHolder) GetAll(attribute string) []*Attribute

func (AnnotationHolder) GetDescription

func (holder AnnotationHolder) GetDescription() string

func (AnnotationHolder) GetFirst

func (holder AnnotationHolder) GetFirst(attribute string) *Attribute

func (AnnotationHolder) GetFirstDescriptionOrEmpty

func (holder AnnotationHolder) GetFirstDescriptionOrEmpty(attribute string) string

func (AnnotationHolder) GetFirstValueOrEmpty

func (holder AnnotationHolder) GetFirstValueOrEmpty(attribute string) string

func (AnnotationHolder) Has

func (holder AnnotationHolder) Has(attribute string) bool

type Attribute

type Attribute struct {
	Name        string
	Value       string
	Properties  map[string]any
	Description string
}

func (Attribute) GetProperty

func (attr Attribute) GetProperty(name string) *any

func (Attribute) HasProperty

func (attr Attribute) HasProperty(name string) bool

type NonAttributeComment

type NonAttributeComment struct {
	Index int
	Value string
}

Jump to

Keyboard shortcuts

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