Documentation
¶
Index ¶
- Constants
- func AppendExtensionPatches(f PatchFunc)
- func AppendToTemplate(text string)
- func EnableJavaExtension(a generator.Config) bool
- func HandleRequest(req *plugin.Request) *plugin.Response
- func Hessian2PatchByReplace(args generator.Config, subDirPath string) error
- func Hessian2PreHook(cfg *generator.Config) error
- func IsHessian2(a generator.Config) bool
- func Run() int
- func ZeroBLength(t *parser.Type, oprot, offset string) string
- func ZeroWriter(t *parser.Type, oprot, buf, offset string) string
- type PatchFunc
- type Patcher
Constants ¶
const ( JavaExtensionOption = "java_extension" DubboCodec = "github.com/kitex-contrib/codec-dubbo" JavaThrift = "java.thrift" JavaThriftAddress = "https://raw.githubusercontent.com/kitex-contrib/codec-dubbo/main/java/java.thrift" )
const Body = `` /* 258-byte string literal not displayed */
const FieldBaseTypeLength = `` /* 473-byte string literal not displayed */
const FieldContainerLength = `` /* 276-byte string literal not displayed */
const FieldDeepCopy = `` /* 329-byte string literal not displayed */
const FieldDeepCopyBaseType = `` /* 749-byte string literal not displayed */
const FieldDeepCopyContainer = `` /* 298-byte string literal not displayed */
const FieldDeepCopyList = `` /* 590-byte string literal not displayed */
const FieldDeepCopyMap = `` /* 742-byte string literal not displayed */
const FieldDeepCopySet = `` /* 588-byte string literal not displayed */
const FieldDeepCopyStructLike = `` /* 572-byte string literal not displayed */
const FieldFastRead = `` /* 329-byte string literal not displayed */
const FieldFastReadBaseType = `` /* 604-byte string literal not displayed */
const FieldFastReadContainer = `` /* 298-byte string literal not displayed */
const FieldFastReadList = `` /* 1343-byte string literal not displayed */
const FieldFastReadMap = `` /* 2210-byte string literal not displayed */
const FieldFastReadSet = `` /* 1340-byte string literal not displayed */
const FieldFastReadStructLike = `` /* 499-byte string literal not displayed */
const FieldFastWrite = `` /* 340-byte string literal not displayed */
const FieldFastWriteBaseType = `` /* 528-byte string literal not displayed */
const FieldFastWriteContainer = `` /* 291-byte string literal not displayed */
const FieldFastWriteList = `` /* 825-byte string literal not displayed */
const FieldFastWriteMap = `` /* 1314-byte string literal not displayed */
const FieldFastWriteSet = `` /* 850-byte string literal not displayed */
const FieldFastWriteStructLike = `` /* 359-byte string literal not displayed */
const FieldFixedLengthTypeLength = `` /* 132-byte string literal not displayed */
const FieldLength = `` /* 325-byte string literal not displayed */
const FieldListLength = `` /* 840-byte string literal not displayed */
const FieldMapLength = `` /* 1412-byte string literal not displayed */
const FieldSetLength = `` /* 868-byte string literal not displayed */
const FieldStructLikeLength = `` /* 325-byte string literal not displayed */
const File = ` {{define "file"}} // Code generated by Kitex {{Version}}. DO NOT EDIT. package {{.PkgName}} ` + ImportInsertPoint + ` {{InsertionPoint "KitexUnusedProtection"}} // unused protection var ( _ = fmt.Formatter(nil) {{- UseStdLibrary "fmt"}} _ = (*bytes.Buffer)(nil) {{- UseStdLibrary "bytes"}} _ = (*strings.Builder)(nil) {{- UseStdLibrary "strings"}} _ = reflect.Type(nil) {{- UseStdLibrary "reflect"}} _ = thrift.STOP {{- UseLib "github.com/cloudwego/gopkg/protocol/thrift" ""}} {{- if and (and GenerateArgsResultTypes Features.KeepUnknownFields) (ne (len .Scope.Services) 0)}} {{- UseStdLibrary "unknown"}} {{- end}} ) {{template "body" .}} {{end}}{{/* define "file" */}} `
const ImportInsertPoint = "// imports insert-point"
const Imports = `` /* 222-byte string literal not displayed */
const JavaClassName = `` /* 296-byte string literal not displayed */
const PatchArgsAndResult = `` /* 981-byte string literal not displayed */
const PluginName = "thrift-gen-kitex"
PluginName is the link name when the kitex binary is used as a plugin for thriftgo.
const Processor = `` /* 482-byte string literal not displayed */
const RegisterHessian = `` /* 2580-byte string literal not displayed */
const StructLikeCodec = `` /* 523-byte string literal not displayed */
const StructLikeDeepCopy = `` /* 455-byte string literal not displayed */
TODO: check required
const StructLikeDeepEqualEmpty = `` /* 155-byte string literal not displayed */
StructLikeDeepEqualEmpty when using slim template, there's no need to generate deep equal for xxArgs and xxResult struct, to avoid the template compile error, use this empty definition instead.
const StructLikeFastRead = `` /* 3116-byte string literal not displayed */
const StructLikeFastReadField = `` /* 976-byte string literal not displayed */
const StructLikeFastWrite = `` /* 199-byte string literal not displayed */
const StructLikeFastWriteField = `` /* 1406-byte string literal not displayed */
const StructLikeFastWriteNocopy = `` /* 1101-byte string literal not displayed */
const StructLikeFieldLength = `` /* 1241-byte string literal not displayed */
const StructLikeLength = `` /* 917-byte string literal not displayed */
const StructLikeProtocol = `` /* 929-byte string literal not displayed */
const TheUseOptionMessage = "kitex_gen is not generated due to the -use option"
TheUseOptionMessage indicates that the generating of kitex_gen is aborted due to the -use option.
const ValidateSet = `` /* 592-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AppendExtensionPatches ¶ added in v0.14.0
func AppendExtensionPatches(f PatchFunc)
func EnableJavaExtension ¶ added in v0.8.0
func Hessian2PatchByReplace ¶ added in v0.9.0
Hessian2PatchByReplace args is the arguments from command, subDirPath used for xx/xx/xx
func Hessian2PreHook ¶ added in v0.8.0
Hessian2PreHook Hook before building cmd
func IsHessian2 ¶ added in v0.8.0
Types ¶
type Patcher ¶ added in v0.14.0
type Patcher struct {
// contains filtered or unexported fields
}
func (*Patcher) IsHessian2 ¶ added in v0.14.0
func (*Patcher) UseFrugalForStruct ¶ added in v0.14.0
func (p *Patcher) UseFrugalForStruct(st *golang.StructLike) bool
UseFrugalForStruct judge if we need to replace fastCodec to frugal implementation. It's related to the argument '-frugal-struct'.