parser

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GORS = "@GORS"

	Path = "@Path"

	GET     Method = "@GET"
	POST    Method = "@POST"
	PUT     Method = "@PUT"
	DELETE  Method = "@DELETE"
	PATCH   Method = "@PATCH"
	HEAD    Method = "@HEAD"
	CONNECT Method = "@CONNECT"
	OPTIONS Method = "@OPTIONS"
	TRACE   Method = "@TRACE"

	ReaderBinding        = "@ReaderBinding"
	BytesBinding         = "@BytesBinding"
	StringBinding        = "@StringBinding"
	UriBinding           = "@UriBinding"
	QueryBinding         = "@QueryBinding"
	HeaderBinding        = "@HeaderBinding"
	JSONBinding          = "@JSONBinding"
	XMLBinding           = "@XMLBinding"
	FormBinding          = "@FormBinding"
	FormPostBinding      = "@FormPostBinding"
	FormMultipartBinding = "@FormMultipartBinding"
	ProtoBufBinding      = "@ProtoBufBinding"
	MsgPackBinding       = "@MsgPackBinding"
	YAMLBinding          = "@YAMLBinding"
	TOMLBinding          = "@TOMLBinding"
	CustomBinding        = "@CustomBinding"
	ProtoJSONBinding     = "@ProtoJSONBinding"

	ReaderRender   = "@ReaderRender"
	BytesRender    = "@BytesRender"
	StringRender   = "@StringRender"
	TextRender     = "@TextRender"
	HTMLRender     = "@HTMLRender"
	RedirectRender = "@RedirectRender"

	JSONRender         = "@JSONRender"
	IndentedJSONRender = "@IndentedJSONRender"
	SecureJSONRender   = "@SecureJSONRender"
	JSONPJSONRender    = "@JSONPJSONRender"
	PureJSONRender     = "@PureJSONRender"
	AsciiJSONRender    = "@AsciiJSONRender"
	XMLRender          = "@XMLRender"
	YAMLRender         = "@YAMLRender"
	ProtoBufRender     = "@ProtoBufRender"
	MsgPackRender      = "@MsgPackRender"
	TOMLRender         = "@TOMLRender"
	CustomRender       = "@CustomRender"
	ProtoJSONRender    = "@ProtoJSONRender"
)
View Source
const (
	PlainContentType         = "text/plain"
	HTMLContentType          = "text/html"
	JSONContentType          = "application/json"
	JSONPContentType         = "application/javascript"
	XMLContentType           = "application/xml"
	XML2ContentType          = "text/xml"
	FormContentType          = "application/x-www-form-urlencoded"
	FormMultipartContentType = "multipart/form-data"
	ProtoBufContentType      = "application/x-protobuf"
	MsgPackContentType       = "application/x-msgpack"
	MsgPack2ContentType      = "application/msgpack"
	YAMLContentType          = "application/x-yaml"
	TOMLContentType          = "application/toml"
)

Content-Type

Variables

This section is empty.

Functions

func ExtractValue

func ExtractValue(s string, annotation string) (string, bool)

Types

type Method

type Method string

func (Method) EqualsIgnoreCase

func (m Method) EqualsIgnoreCase(str string) bool

func (Method) HttpMethod

func (m Method) HttpMethod() string

func (Method) String

func (m Method) String() string

type RouterInfo

type RouterInfo struct {
	HttpMethod         Method
	Description        string
	Path               string
	MethodName         string
	FullMethodName     string
	BindingContentType string
	Bindings           []string
	RenderContentType  string
	Render             string
	HandlerName        string
	ProtoMethod        *protogen.Method
	FuncType           *ast.FuncType
}

func NewRouter

func NewRouter(methodName string, rpcMethodName string, comments []string) *RouterInfo

func (RouterInfo) FileParams

func (i RouterInfo) FileParams() []string

func (RouterInfo) FormParams

func (i RouterInfo) FormParams() []string

func (RouterInfo) HeaderParams

func (i RouterInfo) HeaderParams() []string

func (RouterInfo) PathParams

func (i RouterInfo) PathParams() []string

func (RouterInfo) QueryParams

func (i RouterInfo) QueryParams() []string

type ServiceInfo

type ServiceInfo struct {
	Name        string
	Description string
	BasePath    string
	Routers     []*RouterInfo
}

func NewService

func NewService(name string, comments []string) *ServiceInfo

func (*ServiceInfo) Swagger

func (info *ServiceInfo) Swagger() *spec.Swagger

Jump to

Keyboard shortcuts

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