parser

package
v0.0.0-...-7953320 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ParameterPositionQuery byte = iota
	ParameterPositionBody
	ParameterPositionPath
	ParameterPositionHeader
	ParameterPositionFormData
)

Variables

View Source
var (
	ObjDateTime = &Object{
		Name:  "Timestamp",
		Route: []string{"Timestamp"},
		Properties: []ObjectProperty{
			{
				Name:     "seconds",
				Required: true,
				Type:     scalarInt64,
			},
			{
				Name:     "nanos",
				Required: true,
				Type:     scalarInt32,
			},
		},
	}
)

Functions

This section is empty.

Types

type Array

type Array struct {
	ElemType Type
}

func (Array) Kind

func (Array) Kind() Kind

type File

type File struct {
	BasePath string
	Location string
	Tags     []Tag
	Objects  []Object
	// contains filtered or unexported fields
}

type Kind

type Kind byte
const (
	KindUnknown Kind = iota
	KindString
	KindInt32
	KindInt64
	KindFloat32
	KindFloat64
	KindBoolean
	KindArray
	KindObject
	KindMap
	KindFile
	KindDateTime
	KindNull
)

func (Kind) String

func (i Kind) String() string

type Map

type Map struct {
	Route    []string
	ElemType Type
}

func (Map) Kind

func (Map) Kind() Kind

type Method

type Method struct {
	Path        string
	OperationID string
	Description string
	HTTPMethod  string
	Parameters  []MethodParameter
	Responses   []MethodResponse
}

type MethodParameter

type MethodParameter struct {
	Type        Type
	Position    byte
	Name        string
	Description string
	Required    bool
}

type MethodResponse

type MethodResponse struct {
	StatusCode  int
	Description string
	ResultType  Type
}

type Object

type Object struct {
	Name       string
	Route      []string
	Properties []ObjectProperty
}

func (*Object) GetPropertyByName

func (o *Object) GetPropertyByName(name string) *ObjectProperty

func (Object) Kind

func (Object) Kind() Kind

type ObjectProperty

type ObjectProperty struct {
	Name        string
	Description string
	Required    bool
	Type        Type
}

type Parser

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

func (*Parser) Parse

func (p *Parser) Parse(loc string, r io.Reader) (*File, error)

func (Parser) ParsedFiles

func (p Parser) ParsedFiles() []*File

type Scalar

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

func (Scalar) Kind

func (s Scalar) Kind() Kind

type Tag

type Tag struct {
	Name        string
	Description string
	Methods     []Method
}

type Type

type Type interface {
	Kind() Kind
}

Jump to

Keyboard shortcuts

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