codedom

package
v0.0.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

Len is the number of elements in the collection.

func (ControllerDescriptorCollection) Less

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

Collection returns the descriptors as collection

func (ControllerDescriptorMap) Get

Get returns a descriptor

type InfoDescriptor

type InfoDescriptor struct {
	Title          string
	Description    string
	TermsOfService string
	Version        string
}

InfoDescriptor provides some information

type Metadata

type Metadata map[string]interface{}

Metadata of the TypeDescriptor

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

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

Tags returns the tags for this parameter

type ParameterDescriptorCollection

type ParameterDescriptorCollection []*ParameterDescriptor

ParameterDescriptorCollection definition

func (ParameterDescriptorCollection) Len

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

Tags returns the underlying tags

type PropertyDescriptorCollection

type PropertyDescriptorCollection []*PropertyDescriptor

PropertyDescriptorCollection definition

func (PropertyDescriptorCollection) Len

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

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

func (*Resolver) Resolve

func (r *Resolver) Resolve(swagger *openapi3.Swagger) (*SpecDescriptor, error)

Resolve resolves the 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

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

type TagDescriptor struct {
	Key     string
	Name    string
	Options []string
}

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) Kind

func (d *TypeDescriptor) Kind() string

Kind returns the golang kind

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) Clear

func (m TypeDescriptorMap) Clear()

Clear clears the map

func (TypeDescriptorMap) Collection

Collection return the map as collection

func (TypeDescriptorMap) Get

Get returns the TypeDescriptor for given name

Jump to

Keyboard shortcuts

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