Documentation
¶
Index ¶
- type Document
- type Documents
- func (documents Documents) Add(doc *Document) (ok bool)
- func (documents Documents) FindByVersion(version versions.Version) (v NameSortedDocuments)
- func (documents Documents) Len() int
- func (documents Documents) Merge(o Documents) Documents
- func (documents Documents) Openapi(openapiVersion string, appId string, appName string, ...) (api *oas.API)
- func (documents Documents) Remove(name string, version versions.Version)
- type Element
- func Any() *Element
- func Array(item *Element) *Element
- func Bool() *Element
- func Bytes() *Element
- func Complex128() *Element
- func Complex64() *Element
- func Date() *Element
- func DateTime() *Element
- func Duration() *Element
- func Empty() *Element
- func Float32() *Element
- func Float64() *Element
- func Ident(path string, name string, target *Element) *Element
- func Int() *Element
- func Int32() *Element
- func Int64() *Element
- func JsonRaw() *Element
- func Map(value *Element) *Element
- func NewElement(path string, name string, typ string, format string, title string, ...) *Element
- func Password() *Element
- func Ref(path string, name string) *Element
- func String() *Element
- func Struct(path string, name string) *Element
- func Time() *Element
- func Uint() *Element
- func Uint32() *Element
- func Uint64() *Element
- func Uint8() *Element
- func (element *Element) AddEnum(v ...string) *Element
- func (element *Element) AddProperty(name string, prop *Element) *Element
- func (element *Element) AsDeprecated() *Element
- func (element *Element) AsPassword() *Element
- func (element *Element) AsRequired() *Element
- func (element *Element) Key() (v string)
- func (element *Element) Schema() (v *oas.Schema)
- func (element *Element) SetDescription(description string) *Element
- func (element *Element) SetFormat(format string) *Element
- func (element *Element) SetName(name string) *Element
- func (element *Element) SetPath(path string) *Element
- func (element *Element) SetTitle(title string) *Element
- func (element *Element) SetValidation(validation *ElementValidation) *Element
- type ElementValidation
- type Elements
- type Error
- type Fn
- type NameSortedDocuments
- type VersionSortedDocuments
- func (documents VersionSortedDocuments) Get(version versions.Version) (document *Document, has bool)
- func (documents VersionSortedDocuments) Len() int
- func (documents VersionSortedDocuments) Less(i, j int) bool
- func (documents VersionSortedDocuments) Merge(o VersionSortedDocuments) VersionSortedDocuments
- func (documents VersionSortedDocuments) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶ added in v1.0.10
type Document struct { // Name // as tag Name string `json:"name"` // Description // as description of tag, support markdown Description string `json:"description"` // Version Version versions.Version `json:"version"` // Fns Fns []*Fn `json:"fns"` // Elements Elements map[string]*Element `json:"elements"` }
func NewDocument ¶ added in v1.0.10
type Documents ¶ added in v1.0.10
type Documents map[string]VersionSortedDocuments
func NewDocuments ¶ added in v1.0.10
func NewDocuments() Documents
func (Documents) FindByVersion ¶ added in v1.0.10
func (documents Documents) FindByVersion(version versions.Version) (v NameSortedDocuments)
type Element ¶
type Element struct { Path string `json:"path,omitempty"` Name string `json:"name,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Type string `json:"type,omitempty"` Format string `json:"format,omitempty"` Enums []string `json:"enums,omitempty"` Required bool `json:"required,omitempty"` Validation *ElementValidation `json:"validation,omitempty"` Properties map[string]*Element `json:"properties,omitempty"` Additional bool `json:"additional,omitempty"` Deprecated bool `json:"deprecated,omitempty"` }
func Complex128 ¶ added in v0.14.0
func Complex128() *Element
func NewElement ¶
func (*Element) AddProperty ¶
func (*Element) AsDeprecated ¶
func (*Element) AsPassword ¶ added in v1.0.5
func (*Element) AsRequired ¶
func (*Element) SetDescription ¶
func (*Element) SetValidation ¶
func (element *Element) SetValidation(validation *ElementValidation) *Element
type ElementValidation ¶ added in v0.14.0
type ElementValidation struct { Name string `json:"name,omitempty"` I18n map[string]string `json:"i18n,omitempty"` }
func NewElementValidation ¶ added in v0.14.0
func NewElementValidation(name string, i18ns ...string) (v *ElementValidation)
type Error ¶ added in v1.0.10
func (Error) Descriptions ¶ added in v1.0.10
type Fn ¶
type Fn struct { Name string `json:"name,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Authorization bool `json:"authorization,omitempty"` Argument *Element `json:"argument,omitempty"` Result *Element `json:"result,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Errors []Error `json:"errors,omitempty"` }
type NameSortedDocuments ¶ added in v1.0.10
type NameSortedDocuments []*Document
func (NameSortedDocuments) Len ¶ added in v1.0.10
func (documents NameSortedDocuments) Len() int
func (NameSortedDocuments) Less ¶ added in v1.0.10
func (documents NameSortedDocuments) Less(i, j int) bool
func (NameSortedDocuments) Swap ¶ added in v1.0.10
func (documents NameSortedDocuments) Swap(i, j int)
type VersionSortedDocuments ¶ added in v1.0.10
type VersionSortedDocuments []*Document
func (VersionSortedDocuments) Get ¶ added in v1.0.10
func (documents VersionSortedDocuments) Get(version versions.Version) (document *Document, has bool)
func (VersionSortedDocuments) Len ¶ added in v1.0.10
func (documents VersionSortedDocuments) Len() int
func (VersionSortedDocuments) Less ¶ added in v1.0.10
func (documents VersionSortedDocuments) Less(i, j int) bool
func (VersionSortedDocuments) Merge ¶ added in v1.0.10
func (documents VersionSortedDocuments) Merge(o VersionSortedDocuments) VersionSortedDocuments
func (VersionSortedDocuments) Swap ¶ added in v1.0.10
func (documents VersionSortedDocuments) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.