gogen

package
v0.0.0-...-406ca89 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeBool   = langs.ThriftTypeBool
	TypeByte   = langs.ThriftTypeByte
	TypeI16    = langs.ThriftTypeI16
	TypeI32    = langs.ThriftTypeI32
	TypeI64    = langs.ThriftTypeI64
	TypeDouble = langs.ThriftTypeDouble
	TypeBinary = langs.ThriftTypeBinary
	TypeString = langs.ThriftTypeString
	TypeList   = langs.ThriftTypeList
	TypeMap    = langs.ThriftTypeMap
	TypeSet    = langs.ThriftTypeSet
)

Variables

This section is empty.

Functions

func Tpl

func Tpl() *template.Template

Types

type GoGen

type GoGen struct {
	langs.BaseGen
}

func (*GoGen) Generate

func (this *GoGen) Generate(output string, parsedThrift map[string]*parser.Thrift)

type Package

type Package struct {
	PkgName    string
	ImportPath string

	TplUtils

	ValidateParams bool
	// contains filtered or unexported fields
}

func (*Package) Constants

func (this *Package) Constants() map[string]*parser.Constant

func (*Package) Enums

func (this *Package) Enums() map[string]*parser.Enum

func (*Package) Exceptions

func (this *Package) Exceptions() map[string]*parser.Struct

func (*Package) FullImportPath

func (this *Package) FullImportPath() string

func (*Package) GenConstants

func (this *Package) GenConstants(constant *parser.Constant) string

func (*Package) GenServiceMethodArguments

func (this *Package) GenServiceMethodArguments(fields []*parser.Field) string

func (*Package) GenServiceMethodReturn

func (this *Package) GenServiceMethodReturn(method *parser.Method) string

func (*Package) GenTypeString

func (this *Package) GenTypeString(fieldName string, typ, parent *parser.Type, optional bool) string

func (*Package) GenWebApiServiceParams

func (this *Package) GenWebApiServiceParams(fields []*parser.Field) string

func (*Package) Includes

func (this *Package) Includes() map[string]*Package

func (*Package) IsStruct

func (this *Package) IsStruct(typ *parser.Type) bool

func (*Package) MethodRequestName

func (this *Package) MethodRequestName(service, method string) string

func (*Package) MethodResponseName

func (this *Package) MethodResponseName(service, method string) string

func (*Package) Namespace

func (this *Package) Namespace() string

func (*Package) Namespaces

func (this *Package) Namespaces() map[string]string

func (*Package) Services

func (this *Package) Services() map[string]*parser.Service

func (*Package) Structs

func (this *Package) Structs() map[string]*parser.Struct

func (*Package) Typedefs

func (this *Package) Typedefs() map[string]*parser.Typedef

func (*Package) Unions

func (this *Package) Unions() map[string]*parser.Struct

func (*Package) WebApiPrefix

func (this *Package) WebApiPrefix() string

type TplUtils

type TplUtils struct {
}

func (*TplUtils) FieldTagJson

func (this *TplUtils) FieldTagJson(field *parser.Field) string

func (*TplUtils) FieldTagThrift

func (this *TplUtils) FieldTagThrift(field *parser.Field) string

func (*TplUtils) GenNamespace

func (this *TplUtils) GenNamespace(namespace string) (pkgName string, importPath string)

func (*TplUtils) IsInvalidTypeName

func (this *TplUtils) IsInvalidTypeName(str string) bool

func (*TplUtils) IsNilType

func (this *TplUtils) IsNilType(typ *parser.Type) bool

func (*TplUtils) IsSimpleArguments

func (this *TplUtils) IsSimpleArguments(args []*parser.Field) bool

func (*TplUtils) UpperHead

func (this *TplUtils) UpperHead(name string) string

Jump to

Keyboard shortcuts

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