Versions in this module Expand all Collapse all v4 v4.3.0 Jun 30, 2020 Changes in this version + func FormatCode(filename string, buffer []byte) []byte + func GetFieldMappedProtoOption(field *desc.FieldDescriptorProto) bool + func GetGoPackage(url string) string + func GetGoPath(url string) string + func NewPrinterProxy(printer *Printer) *printerProxy + func OneOrZero(hp handlerParams) string + func P(args ...string) string + func WriteClientStreaming(printer *Printer, params *handlerParams, isSql bool) error + func WriteHandlers(p *Printer, s *Service) (outErr error) + func WriteHooks(p *Printer, s *Service) error + func WriteImports(p *Printer, f *FileStruct) error + func WriteIters(p *Printer, s *Service) (outErr error) + func WritePackageLevelDeclarations(p *Printer, files *FileList) error + func WritePersistServerStruct(printer *Printer, service, db string) error + func WriteQueries(p *Printer, s *Service) error + func WriteRows(p *Printer, s *Service) (outErr error) + func WriteServerStream(printer *Printer, params *handlerParams, isSql bool) error + func WriteTypeMappings(p *Printer, s *Service) error + func WriteUnary(printer *Printer, params *handlerParams, isSql bool) error + type FileList []*FileStruct + func NewFileList() *FileList + func (fl *FileList) Append(file *FileStruct) + func (fl *FileList) FindFile(desc *descriptor.FileDescriptorProto) *FileStruct + func (fl *FileList) GetOrCreateFile(desc *descriptor.FileDescriptorProto, allStructs *StructList, dependency bool, ...) *FileStruct + func (fl *FileList) Process() error + type FileStruct struct + AllStructures *StructList + Dependency bool + Desc *descriptor.FileDescriptorProto + ImportList *Imports + Opts PersistOpts + ServiceList *Services + Structures *StructList + func NewFileStruct(desc *descriptor.FileDescriptorProto, allStructs *StructList, dependency bool, ...) *FileStruct + func (f *FileStruct) DifferentImpl() bool + func (f *FileStruct) Generate() ([]byte, error) + func (f *FileStruct) GetFileName() string + func (f *FileStruct) GetFullGoPackage() string + func (f *FileStruct) GetGoPackage() string + func (f *FileStruct) GetGoPath() string + func (f *FileStruct) GetGoTypeName(typ string) string + func (f *FileStruct) GetImplDir() string + func (f *FileStruct) GetImplFileName(sourceRelative bool) string + func (f *FileStruct) GetImplPackage() string + func (f *FileStruct) GetOrigName() string + func (f *FileStruct) GetPackageName() string + func (f *FileStruct) GetPersistFile() string + func (f *FileStruct) GetPersistPackageOption() string + func (f *FileStruct) GetServices() *Services + func (f *FileStruct) IsSameAsMyPackage(pkg string) bool + func (f *FileStruct) NeedImport(pkg string) bool + func (f *FileStruct) NotSameAsMyPackage(pkg string) bool + func (f *FileStruct) Process() error + func (f *FileStruct) ProcessImports() + func (f *FileStruct) ProcessImportsForType(name string) + func (f *FileStruct) SanatizeImports() + type Generator struct + AllStructures *StructList + Files *FileList + OriginalRequest *plugin_go.CodeGeneratorRequest + Response *plugin_go.CodeGeneratorResponse + SourceRelative bool + func NewGenerator(request *plugin_go.CodeGeneratorRequest) *Generator + func (g *Generator) CommandLineParameters(parameter string) error + func (g *Generator) GetResponse() (*plugin_go.CodeGeneratorResponse, error) + func (g *Generator) Process() error + type GeneratorStruct interface + Generate func() string + type GenericDescriptor interface + GetName func() string + type HasLabelAndType interface + GetLabel func() descriptor.FieldDescriptorProto_Label + GetType func() descriptor.FieldDescriptorProto_Type + GetTypeName func() string + type Import struct + GoImportPath string + GoPackageName string + type Imports []*Import + func EmptyImportList() *Imports + func (il *Imports) Exist(pkg string) bool + func (il *Imports) GetGoNameByStruct(str *Struct) *Import + func (il *Imports) GetImportPkgForPath(path string) string + func (il *Imports) GetOrAddImport(goPkg, goPath string) string + func (il Imports) String() string + type Match struct + func Matcher(s *Service) Match + func (Match) AfterHook(mopt *MethodProtoOpts) bool + func (Match) BeforeHook(mopt *MethodProtoOpts) bool + func (Match) BidiStreaming(mopt *MethodProtoOpts) bool + func (Match) ClientStreaming(mopt *MethodProtoOpts) bool + func (Match) FilterFieldNames(names []string) func(*desc.FieldDescriptorProto, *QueryProtoOpts) bool + func (Match) MatchMethod(mopt *MethodProtoOpts) func(*QueryProtoOpts) bool + func (Match) MatchQuery(opt *QueryProtoOpts) func(*desc.FieldDescriptorProto, *QueryProtoOpts) bool + func (Match) MatchQueryInField(f *desc.FieldDescriptorProto) func(*desc.FieldDescriptorProto, *QueryProtoOpts) bool + func (Match) MatchQueryName(opt *QueryProtoOpts) func(*MethodProtoOpts) bool + func (Match) MatchQueryOutField(f *desc.FieldDescriptorProto) func(*desc.FieldDescriptorProto, *QueryProtoOpts) bool + func (Match) MatchTypeMapping(f *desc.FieldDescriptorProto) func(*TypeMappingProtoOpts) bool + func (Match) MatchingFieldNames(names []string) func(*desc.FieldDescriptorProto, *QueryProtoOpts) bool + func (Match) QueryFieldFitsDB(field *desc.FieldDescriptorProto, q *QueryProtoOpts) bool + func (Match) QueryFieldIsMessage(field *desc.FieldDescriptorProto, q *QueryProtoOpts) bool + func (Match) QueryFieldIsRepeated(field *desc.FieldDescriptorProto, q *QueryProtoOpts) bool + func (Match) QueryFieldScannedAsInt64(field *desc.FieldDescriptorProto, q *QueryProtoOpts) bool + func (Match) ServerStreaming(mopt *MethodProtoOpts) bool + func (Match) Unary(mopt *MethodProtoOpts) bool + func (m *Match) EachMethod(do func(*MethodProtoOpts), matches ...func(*MethodProtoOpts) bool) + func (m *Match) EachMethodIn(do func(*desc.FieldDescriptorProto, *MethodProtoOpts), ...) + func (m *Match) EachMethodOut(do func(*desc.FieldDescriptorProto, *MethodProtoOpts), ...) + func (m *Match) EachQuery(do func(*QueryProtoOpts), matches ...func(*QueryProtoOpts) bool) + func (m *Match) EachQueryIn(do func(*desc.FieldDescriptorProto, *QueryProtoOpts), ...) + func (m *Match) EachQueryOut(do func(*desc.FieldDescriptorProto, *QueryProtoOpts), ...) + func (m *Match) EachTM(do func(*TypeMappingProtoOpts), matches ...func(*TypeMappingProtoOpts) bool) + func (m *Match) Err() error + func (m Match) QueryFieldIsMapped(field *desc.FieldDescriptorProto, q *QueryProtoOpts) bool + type MethodProtoOpts struct + func NewMethodProtoOpts(opt *desc.MethodDescriptorProto, all *StructList) (*MethodProtoOpts, error) + type PersistOpts struct + PersistLibRoot string + Raw map[string]string + func ParseCommandLine(str string) PersistOpts + type Printer struct + func (p *Printer) P(formatString string, args ...interface{}) + func (p *Printer) PA(formatStrings []string, args ...interface{}) + func (p *Printer) PTemplate(t string, dot interface{}) + func (p *Printer) Q(args ...string) + func (p *Printer) String() string + type QueryProtoOpts struct + func NewQueryProtoOpts(qopt *persist.QLImpl, all *StructList) (*QueryProtoOpts, error) + type Service struct + AllStructs *StructList + Desc *desc.ServiceDescriptorProto + File *FileStruct + Package string + func (s *Service) GetName() string + func (s *Service) GetQueriesOption() *persist.QueryOpts + func (s *Service) GetServiceType() *persist.PersistenceOptions + func (s *Service) GetTypeMapping() *persist.TypeMapping + func (s *Service) GetUndoctoredQueryByName(queryName string) (*persist.QLImpl, error) + func (s *Service) IsSQL() bool + func (s *Service) IsSpanner() bool + type Services []*Service + func (s *Services) AddService(pkg string, desc *desc.ServiceDescriptorProto, allStructs *StructList, ...) *Service + func (s Services) HasPersistService() bool + type Struct struct + Descriptor GenericDescriptor + EnumDesc *desc.EnumDescriptorProto + File *FileStruct + GoName string + IsInnerType bool + IsMessage bool + MsgDesc *desc.DescriptorProto + Package string + ParentDescriptor *Struct + ProtoName string + func (s *Struct) GetFieldDescriptorsIfMessage() ([]*desc.FieldDescriptorProto, bool) + func (s *Struct) GetFieldType(field string) *desc.FieldDescriptorProto + func (s *Struct) GetGoName() string + func (s *Struct) GetGoPath() string + func (s *Struct) GetImportedFiles() *FileList + func (s *Struct) GetProtoName() string + type StructList []*Struct + func NewStructList() *StructList + func (s *StructList) AddEnum(enum *desc.EnumDescriptorProto, parent *Struct, pkg string, file *FileStruct) *Struct + func (s *StructList) AddMessage(message *desc.DescriptorProto, parent *Struct, pkg string, file *FileStruct) *Struct + func (s *StructList) Append(struc *Struct) + func (s *StructList) GetStructByFieldDesc(fld *desc.FieldDescriptorProto) *Struct + func (s *StructList) GetStructByName(name string) *Struct + func (s *StructList) GetStructByProtoName(name string) *Struct + type TmAsField struct + func (t TmAsField) GetLabel() descriptor.FieldDescriptorProto_Label + func (t TmAsField) GetType() descriptor.FieldDescriptorProto_Type + func (t TmAsField) GetTypeName() string + type TypeMappingProtoOpts struct + func NewTypeMappingProtoOpts(opt *persist.TypeMapping_TypeDescriptor, all *StructList) (*TypeMappingProtoOpts, error)