Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTagOption(args *config.Argument) []generator.Option
- type NameSpace
- type PackageReference
- type Plugin
- type ResolvedSymbol
- type Resolver
- func (resolver *Resolver) ExportReferred(all, needMain bool) (ret []*PackageReference)
- func (resolver *Resolver) Get(name string) *Symbol
- func (resolver *Resolver) GetRefModel(includeBase string) (*model.Model, error)
- func (resolver *Resolver) LoadAll(ast *parser.Thrift) error
- func (resolver *Resolver) LoadOne(ast *parser.Thrift) (NameSpace, error)
- func (resolver *Resolver) ResolveConstantValue(constant *parser.ConstValue) (model.Literal, error)
- func (resolver *Resolver) ResolveIdentifier(id string) (ret ResolvedSymbol, err error)
- func (resolver *Resolver) ResolveType(typ *parser.Type) (*model.Type, error)
- func (resolver *Resolver) ResolveTypeName(typ *parser.Type) (string, error)
- type Symbol
Constants ¶
View Source
const ( AnnotationQuery = "api.query" AnnotationForm = "api.form" AnnotationPath = "api.path" AnnotationHeader = "api.header" AnnotationCookie = "api.cookie" AnnotationBody = "api.body" AnnotationRawBody = "api.raw_body" AnnotationJsConv = "api.js_conv" AnnotationNone = "api.none" AnnotationFileName = "api.file_name" AnnotationValidator = "api.vd" AnnotationGoTag = "go.tag" )
View Source
const ( ApiGet = "api.get" ApiPost = "api.post" ApiPut = "api.put" ApiPatch = "api.patch" ApiDelete = "api.delete" ApiOptions = "api.options" ApiHEAD = "api.head" ApiAny = "api.any" ApiPath = "api.path" ApiSerializer = "api.serializer" ApiGenPath = "api.handler_path" )
View Source
const ( ApiBaseDomain = "api.base_domain" ApiServiceGroup = "api.service_group" ApiServiceGenDir = "api.service_gen_dir" // handler_dir for handler_by_service ApiServicePath = "api.service_path" // declare the path to the service's handler according to this annotation for handler_by_method )
Variables ¶
View Source
var ( ConstTrue = Symbol{ IsValue: true, Type: model.TypeBool, Value: true, Scope: &BaseThrift, } ConstFalse = Symbol{ IsValue: true, Type: model.TypeBool, Value: false, Scope: &BaseThrift, } ConstEmptyString = Symbol{ IsValue: true, Type: model.TypeString, Value: "", Scope: &BaseThrift, } )
View Source
var ( HttpMethodAnnotations = map[string]string{ ApiGet: "GET", ApiPost: "POST", ApiPut: "PUT", ApiPatch: "PATCH", ApiDelete: "DELETE", ApiOptions: "OPTIONS", ApiHEAD: "HEAD", ApiAny: "ANY", } HttpMethodOptionAnnotations = map[string]string{ ApiGenPath: "handler_path", } BindingTags = map[string]string{ AnnotationPath: "path", AnnotationQuery: "query", AnnotationHeader: "header", AnnotationCookie: "cookie", AnnotationBody: "json", AnnotationForm: "form", AnnotationRawBody: "raw_body", } SerializerTags = map[string]string{ ApiSerializer: "serializer", } ValidatorTags = map[string]string{AnnotationValidator: "vd"} )
View Source
var BaseThrift = parser.Thrift{}
View Source
var NameStyle = styles.NewNamingStyle("thriftgo")
Functions ¶
Types ¶
type NameSpace ¶
func LoadBaseIdentifier ¶
func LoadBaseIdentifier() NameSpace
type PackageReference ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) GetResponse ¶
type ResolvedSymbol ¶
func (ResolvedSymbol) Expression ¶
func (rs ResolvedSymbol) Expression() string
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func (*Resolver) ExportReferred ¶
func (resolver *Resolver) ExportReferred(all, needMain bool) (ret []*PackageReference)
func (*Resolver) GetRefModel ¶
func (*Resolver) ResolveConstantValue ¶
func (*Resolver) ResolveIdentifier ¶
func (resolver *Resolver) ResolveIdentifier(id string) (ret ResolvedSymbol, err error)
func (*Resolver) ResolveType ¶
Click to show internal directories.
Click to hide internal directories.