Documentation
¶
Index ¶
- type ControllerDescriptor
- type ControllerDescriptorCollection
- type ControllerDescriptorMap
- type InfoDescriptor
- type Metadata
- type OperationDescriptor
- type OperationDescriptorCollection
- type ParameterDescriptor
- type ParameterDescriptorCollection
- type PropertyDescriptor
- type PropertyDescriptorCollection
- type RequestDescriptor
- type RequestDescriptorCollection
- type Resolver
- type ResolverContext
- type ResponseDescriptor
- type ResponseDescriptorCollection
- type SpecDescriptor
- type TagDescriptor
- type TagDescriptorCollection
- type TypeDescriptor
- type TypeDescriptorCollection
- type TypeDescriptorMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControllerDescriptor ¶
type ControllerDescriptor struct {
Name string
Description string
Operations OperationDescriptorCollection
}
ControllerDescriptor definition
type ControllerDescriptorCollection ¶
type ControllerDescriptorCollection []*ControllerDescriptor
ControllerDescriptorCollection definition
func (ControllerDescriptorCollection) Len ¶
func (t ControllerDescriptorCollection) Len() int
Len is the number of elements in the collection.
func (ControllerDescriptorCollection) Less ¶
func (t ControllerDescriptorCollection) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (ControllerDescriptorCollection) Swap ¶
func (t ControllerDescriptorCollection) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type ControllerDescriptorMap ¶
type ControllerDescriptorMap map[string]*ControllerDescriptor
ControllerDescriptorMap definition
func (ControllerDescriptorMap) Add ¶
func (m ControllerDescriptorMap) Add(descriptor *ControllerDescriptor)
Add adds a descriptor to the map
func (ControllerDescriptorMap) Clear ¶
func (m ControllerDescriptorMap) Clear()
Clear clears the map
func (ControllerDescriptorMap) Collection ¶
func (m ControllerDescriptorMap) Collection() ControllerDescriptorCollection
Collection returns the descriptors as collection
func (ControllerDescriptorMap) Get ¶
func (m ControllerDescriptorMap) Get(key string) *ControllerDescriptor
Get returns a descriptor
type InfoDescriptor ¶
InfoDescriptor provides some information
type OperationDescriptor ¶
type OperationDescriptor struct {
Method string
Path string
Name string
Summary string
Description string
Deprecated bool
Tags []string
Requests RequestDescriptorCollection
Responses ResponseDescriptorCollection
}
OperationDescriptor definition
func (*OperationDescriptor) DeprecationMessage ¶
func (d *OperationDescriptor) DeprecationMessage() string
DeprecationMessage returns the deprecation message
type OperationDescriptorCollection ¶
type OperationDescriptorCollection []*OperationDescriptor
OperationDescriptorCollection definition
func (OperationDescriptorCollection) Len ¶
func (t OperationDescriptorCollection) Len() int
Len is the number of elements in the collection.
func (OperationDescriptorCollection) Less ¶
func (t OperationDescriptorCollection) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (OperationDescriptorCollection) Swap ¶
func (t OperationDescriptorCollection) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type ParameterDescriptor ¶
type ParameterDescriptor struct {
Name string
In string
Description string
Style string
Explode bool
Required bool
Deprecated bool
ParameterType *TypeDescriptor
}
ParameterDescriptor definition
func (*ParameterDescriptor) Tags ¶
func (p *ParameterDescriptor) Tags() TagDescriptorCollection
Tags returns the tags for this parameter
type ParameterDescriptorCollection ¶
type ParameterDescriptorCollection []*ParameterDescriptor
ParameterDescriptorCollection definition
func (ParameterDescriptorCollection) Len ¶
func (t ParameterDescriptorCollection) Len() int
Len is the number of elements in the collection.
func (ParameterDescriptorCollection) Less ¶
func (t ParameterDescriptorCollection) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (ParameterDescriptorCollection) Swap ¶
func (t ParameterDescriptorCollection) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type PropertyDescriptor ¶
type PropertyDescriptor struct {
Name string
Description string
Required bool
ReadOnly bool
WriteOnly bool
IsEmbedded bool
PropertyType *TypeDescriptor
}
PropertyDescriptor definition
func (*PropertyDescriptor) Tags ¶
func (p *PropertyDescriptor) Tags() TagDescriptorCollection
Tags returns the underlying tags
type PropertyDescriptorCollection ¶
type PropertyDescriptorCollection []*PropertyDescriptor
PropertyDescriptorCollection definition
func (PropertyDescriptorCollection) Len ¶
func (t PropertyDescriptorCollection) Len() int
Len is the number of elements in the collection.
func (PropertyDescriptorCollection) Less ¶
func (t PropertyDescriptorCollection) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (PropertyDescriptorCollection) Swap ¶
func (t PropertyDescriptorCollection) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type RequestDescriptor ¶
type RequestDescriptor struct {
ContentType string
Description string
Required bool
Parameters ParameterDescriptorCollection
RequestType *TypeDescriptor
}
RequestDescriptor definition
type RequestDescriptorCollection ¶
type RequestDescriptorCollection []*RequestDescriptor
RequestDescriptorCollection definition
func (RequestDescriptorCollection) Len ¶
func (t RequestDescriptorCollection) Len() int
Len is the number of elements in the collection.
func (RequestDescriptorCollection) Less ¶
func (t RequestDescriptorCollection) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (RequestDescriptorCollection) Swap ¶
func (t RequestDescriptorCollection) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type Resolver ¶
type Resolver struct {
Cache TypeDescriptorMap
Reporter contract.Reporter
}
Resolver resolves all swagger spec
type ResolverContext ¶
type ResolverContext struct {
Name string
Schema *openapi3.SchemaRef
Parent *ResolverContext
Collector flaw.ErrorCollector
}
ResolverContext is the current resolver context
func (*ResolverContext) Array ¶
func (r *ResolverContext) Array() *ResolverContext
Array returns the array context
func (*ResolverContext) Child ¶
func (r *ResolverContext) Child(name string, schema *openapi3.SchemaRef) *ResolverContext
Child returns the child context
func (*ResolverContext) Dereference ¶
func (r *ResolverContext) Dereference() *ResolverContext
Dereference returns the dereferenced context
func (*ResolverContext) IsRoot ¶
func (r *ResolverContext) IsRoot() bool
IsRoot returns true if it's root
func (*ResolverContext) NameOf ¶
func (r *ResolverContext) NameOf(text string) string
NameOf return the name
type ResponseDescriptor ¶
type ResponseDescriptor struct {
Code int
Description string
ContentType string
ResponseType *TypeDescriptor
Parameters ParameterDescriptorCollection
IsDefault bool
}
ResponseDescriptor definition
type ResponseDescriptorCollection ¶
type ResponseDescriptorCollection []*ResponseDescriptor
ResponseDescriptorCollection definition
func (ResponseDescriptorCollection) Len ¶
func (t ResponseDescriptorCollection) Len() int
Len is the number of elements in the collection.
func (ResponseDescriptorCollection) Less ¶
func (t ResponseDescriptorCollection) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (ResponseDescriptorCollection) Swap ¶
func (t ResponseDescriptorCollection) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type SpecDescriptor ¶
type SpecDescriptor struct {
Info *InfoDescriptor
Types TypeDescriptorCollection
Controllers ControllerDescriptorCollection
}
SpecDescriptor represents a spec
type TagDescriptor ¶
TagDescriptor represents a tag
type TagDescriptorCollection ¶
type TagDescriptorCollection []*TagDescriptor
TagDescriptorCollection represents a field tag list
func (TagDescriptorCollection) String ¶
func (tags TagDescriptorCollection) String() string
type TypeDescriptor ¶
type TypeDescriptor struct {
Name string
Description string
IsAny bool
IsMap bool
IsArray bool
IsClass bool
IsEnum bool
IsPrimitive bool
IsAlias bool
IsNullable bool
Key *TypeDescriptor
Element *TypeDescriptor
Default interface{}
Metadata Metadata
Properties PropertyDescriptorCollection
}
TypeDescriptor represents a type
func (*TypeDescriptor) HasProperties ¶
func (d *TypeDescriptor) HasProperties() bool
HasProperties returns true if the type has properties
func (*TypeDescriptor) Namespace ¶
func (d *TypeDescriptor) Namespace() string
Namespace returns the namespace
func (*TypeDescriptor) Tags ¶
func (d *TypeDescriptor) Tags(required bool) TagDescriptorCollection
Tags returns the associated tagss
type TypeDescriptorCollection ¶
type TypeDescriptorCollection []*TypeDescriptor
TypeDescriptorCollection definition
func (TypeDescriptorCollection) Len ¶
func (t TypeDescriptorCollection) Len() int
Len is the number of elements in the collection.
func (TypeDescriptorCollection) Less ¶
func (t TypeDescriptorCollection) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (TypeDescriptorCollection) Swap ¶
func (t TypeDescriptorCollection) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type TypeDescriptorMap ¶
type TypeDescriptorMap map[string]*TypeDescriptor
TypeDescriptorMap definition
func (TypeDescriptorMap) Add ¶
func (m TypeDescriptorMap) Add(descriptor *TypeDescriptor) error
Add adds a type descriptor
func (TypeDescriptorMap) Collection ¶
func (m TypeDescriptorMap) Collection() TypeDescriptorCollection
Collection return the map as collection
func (TypeDescriptorMap) Get ¶
func (m TypeDescriptorMap) Get(name string) *TypeDescriptor
Get returns the TypeDescriptor for given name