decoratorparser

package
v0.0.0-...-f5836ce Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringifyResponse

func StringifyResponse(resp ResponseEntry) string

Types

type DecoratorParser

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

func New

func New(commentsText string, controller string, controllerAction string) *DecoratorParser

func (*DecoratorParser) GetFunctions

func (p *DecoratorParser) GetFunctions() FunctionsResponse

GetFunctions will return a list of functions from the comment text

func (*DecoratorParser) ParseMethod

func (p *DecoratorParser) ParseMethod() HttpMethod

func (*DecoratorParser) ParseResponse

func (p *DecoratorParser) ParseResponse() []ResponseEntry

ParseResponse parses all of the comments for the function, and returns a slice of response entries (if there are any)

type FunctionEntry

type FunctionEntry struct {
	Name      string
	Arguments []string
}

type FunctionsResponse

type FunctionsResponse struct {
	FunctionCalls []FunctionEntry
}

func (*FunctionsResponse) GetCallsByName

func (f *FunctionsResponse) GetCallsByName(name string) []FunctionEntry

func (*FunctionsResponse) GetFirstCallByName

func (f *FunctionsResponse) GetFirstCallByName(name string) *FunctionEntry

GetFirstCallByName, or return nil if no calls exist

type HttpMethod

type HttpMethod struct {
	HttpMethod         string
	Url                string
	IsControllerAction bool
}

type JsonDecodeEntry

type JsonDecodeEntry struct {
	Type             string
	DecodedParamName string
}

type RequiredPackageEntry

type RequiredPackageEntry struct {
	Name string
	Path string
}

type ResponseEntry

type ResponseEntry struct {
	StatusCode  int
	Description string
	Model       string
}

type ReturnType

type ReturnType struct {
	ImportedPackage string
	Type            string
	Prefix          string
}

func ParseReturnType

func ParseReturnType(retType string) ReturnType

type StringifyMethodResponse

type StringifyMethodResponse struct {
	Comment string
}

func StringifyMethod

func StringifyMethod(method HttpMethod) StringifyMethodResponse

Jump to

Keyboard shortcuts

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