documents

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {
	Package     string              `json:"package,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"`
	Enum        []interface{}       `json:"enum,omitempty"`
	Required    bool                `json:"required,omitempty"`
	Validation  string              `json:"validation,omitempty"`
	Properties  map[string]*Element `json:"properties,omitempty"`
	Additional  bool                `json:"additional,omitempty"`
	Deprecated  bool                `json:"deprecated,omitempty"`
	Example     interface{}         `json:"example,omitempty"`
}

func Array

func Array(name string, title string, description string, item *Element) *Element

func Bool

func Bool() *Element

func Date

func Date() *Element

func DateTime

func DateTime() *Element

func Empty

func Empty() *Element

func Float32

func Float32() *Element

func Float64

func Float64() *Element

func Int

func Int() *Element

func Int32

func Int32() *Element

func Int64

func Int64() *Element

func JsonRaw

func JsonRaw() *Element

func Map

func Map(name string, title string, description string, item *Element) *Element

func NewElement

func NewElement(pkg string, name string, typ string, format string, title string, description string) *Element

func RefStruct added in v0.13.1

func RefStruct(pkg string, name string) *Element

func String

func String() *Element

func Struct

func Struct(pkg string, name string, title string, description string) *Element

func (*Element) AddEnum

func (element *Element) AddEnum(v ...interface{}) *Element

func (*Element) AddProperty

func (element *Element) AddProperty(name string, prop *Element) *Element

func (*Element) AsDeprecated

func (element *Element) AsDeprecated() *Element

func (*Element) AsRequired

func (element *Element) AsRequired(validation string) *Element

func (*Element) Key

func (element *Element) Key() (v string)

func (*Element) Schema

func (element *Element) Schema() (v *oas.Schema)

func (*Element) SetDescription

func (element *Element) SetDescription(description string) *Element

func (*Element) SetExample

func (element *Element) SetExample(example interface{}) *Element

func (*Element) SetFormat

func (element *Element) SetFormat(format string) *Element

func (*Element) SetTitle

func (element *Element) SetTitle(title string) *Element

func (*Element) SetValidation

func (element *Element) SetValidation(validation string) *Element

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"`
}

func (*Fn) Argument

func (fn *Fn) Argument() (argument service.ElementDocument)

func (*Fn) Authorization

func (fn *Fn) Authorization() (has bool)

func (*Fn) Deprecated

func (fn *Fn) Deprecated() (deprecated bool)

func (*Fn) Description

func (fn *Fn) Description() (description string)

func (*Fn) Name

func (fn *Fn) Name() (name string)

func (*Fn) Result

func (fn *Fn) Result() (result service.ElementDocument)

func (*Fn) Title

func (fn *Fn) Title() (title string)

type Service

type Service struct {
	// Name
	// as tag
	Name_ string `json:"name"`
	// Description
	// as description of tag, support markdown
	Description_ string `json:"description"`
	// Fns
	Fns_ []service.FnDocument `json:"fns"`
	// Elements
	Elements_ map[string]service.ElementDocument `json:"elements"`
}

func NewService

func NewService(name string, description string) *Service

func (*Service) AddFn

func (svc *Service) AddFn(name string, title string, description string, hasAuthorization bool, deprecated bool, arg *Element, result *Element)

func (*Service) Description

func (svc *Service) Description() (description string)

func (*Service) Elements added in v0.13.1

func (svc *Service) Elements() (elements map[string]service.ElementDocument)

func (*Service) Fns

func (svc *Service) Fns() (fns []service.FnDocument)

func (*Service) Name

func (svc *Service) Name() (name string)

Jump to

Keyboard shortcuts

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