Documentation ¶
Index ¶
- func FormatCode(filename string, buffer []byte) []byte
- func FromScanableFuncName(m *Method) string
- func GetGoPackage(url string) string
- func GetGoPath(url string) string
- func GetSpannerPersistLibTypeName(t TypeDesc) string
- func GetSqlPersistLibTypeName(t TypeDesc) string
- func IterPersistName(m *Method) string
- func IterProtoName(m *Method) string
- func IteratorHelper(m *Method) string
- func P(args ...interface{}) string
- func PersistLibTypeString(m *Method, typ string) string
- func SpannerType(t TypeDesc) string
- func SpannerTypeFieldName(t TypeDesc) string
- func ToParamsFuncName(m *Method) string
- func WriteBuilderHookInterfaceAndFunc(p *Printer, s *Service)
- func WriteBuilderHooksAcceptingFunc(p *Printer, serv *Service)
- type BackendStringer
- type BidiStreamStringer
- func (s *BidiStreamStringer) AfterHook()
- func (s *BidiStreamStringer) BeforeHook()
- func (s *BidiStreamStringer) HandleRow()
- func (s *BidiStreamStringer) Params()
- func (s *BidiStreamStringer) PersistCall()
- func (s *BidiStreamStringer) String() string
- func (s *BidiStreamStringer) Unimplemented() string
- type ClientStreamStringer
- func (s *ClientStreamStringer) AfterHook()
- func (s *ClientStreamStringer) BeforeHook()
- func (s *ClientStreamStringer) HandleRow()
- func (s *ClientStreamStringer) Params()
- func (s *ClientStreamStringer) PersistCall()
- func (s *ClientStreamStringer) String() string
- func (s *ClientStreamStringer) Unimplemented() string
- type FileList
- type 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) GetImplDir() string
- func (f *FileStruct) GetImplFileName() string
- func (f *FileStruct) GetImplPackage() string
- func (f *FileStruct) GetOrigName() string
- func (f *FileStruct) GetPackageName() string
- func (f *FileStruct) GetPersistFile() string
- func (f *FileStruct) GetPersistLibFullFilepath() persistFile
- 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) NeedsPersistLibDir() 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
- type GeneratorStruct
- type GenericDescriptor
- type Import
- type Imports
- type Method
- func (m *Method) DefaultMapping(typ *descriptor.FieldDescriptorProto) string
- func (m *Method) GetAfterHookName() string
- func (m *Method) GetBeforeHookName() string
- func (m *Method) GetFilePackage() string
- func (m *Method) GetGoTypeName(typ string) string
- func (m *Method) GetGoTypeNameByFieldDesc(ty *descriptor.FieldDescriptorProto) string
- func (m *Method) GetInputType() string
- func (m *Method) GetInputTypeMinusPackage() string
- func (m *Method) GetInputTypeStruct() *Struct
- func (m *Method) GetMappedType(typ *descriptor.FieldDescriptorProto) string
- func (m *Method) GetMapping(typ *descriptor.FieldDescriptorProto) *persist.TypeMapping_TypeDescriptor
- func (m *Method) GetMethodOption() *persist.QLImpl
- func (m *Method) GetName() string
- func (m *Method) GetOutputType() string
- func (m *Method) GetOutputTypeMinusPackage() string
- func (m *Method) GetOutputTypeStruct() *Struct
- func (m *Method) GetQuery() string
- func (m *Method) GetTypeDescArrayForStruct(str *Struct) []TypeDesc
- func (m *Method) GetTypeDescForFieldsInStruct(str *Struct) map[string]TypeDesc
- func (m *Method) GetTypeDescForFieldsInStructSnakeCase(str *Struct) map[string]TypeDesc
- func (m *Method) GetTypeDescForQueryFields() map[string]TypeDesc
- func (m *Method) GetTypeMappingOpts() *persist.TypeMapping
- func (m *Method) GetTypeStructByProtoName(proto string) *Struct
- func (m *Method) IsBidiStreaming() bool
- func (m *Method) IsClientStreaming() bool
- func (m *Method) IsSQL() bool
- func (m *Method) IsSelect() bool
- func (m *Method) IsServerStreaming() bool
- func (m *Method) IsSpanner() bool
- func (m *Method) IsUnary() bool
- func (m *Method) Process() error
- func (m *Method) String() string
- type Methods
- type PLInputName
- type PLOutputName
- type PLQueryMethodName
- type PackagePath
- type PersistContent
- type PersistHandlerName
- type PersistHelperName
- type PersistOpts
- type PersistPackage
- type PersistStringer
- func (per *PersistStringer) DeclareSpannerGetter() string
- func (per *PersistStringer) DeclareSqlPackageDefs() string
- func (per *PersistStringer) DefaultFunctionsImpl(service *Service) string
- func (per *PersistStringer) DefaultSpannerFunctionsImpl(method *Method) string
- func (per *PersistStringer) DefaultSqlFunctionsImpl(method *Method) string
- func (per *PersistStringer) HandlersStructDeclaration(service *Service) string
- func (per *PersistStringer) HelperFunctionImpl(service *Service) string
- func (per *PersistStringer) MessageInputDeclaration(method *Method) string
- func (per *PersistStringer) PersistImplBuilder(service *Service) string
- func (per *PersistStringer) QueryInterfaceDefinition(method *Method) string
- func (per *PersistStringer) SpannerQueryFunction(method *Method) string
- func (per *PersistStringer) SqlQueryFunction(method *Method) string
- type Printer
- type ServerStreamStringer
- func (s *ServerStreamStringer) AfterHook()
- func (s *ServerStreamStringer) BeforeHook()
- func (s *ServerStreamStringer) HandleRow()
- func (s *ServerStreamStringer) Params()
- func (s *ServerStreamStringer) PersistCall()
- func (s *ServerStreamStringer) ResultFromRow()
- func (s *ServerStreamStringer) String() string
- func (s *ServerStreamStringer) Unimplemented() string
- type Service
- func (s *Service) GetName() string
- func (s *Service) GetServiceOption() *persist.TypeMapping
- func (s *Service) GetServiceType() *persist.PersistenceOptions
- func (s *Service) IsSQL() bool
- func (s *Service) IsSpanner() bool
- func (s *Service) PrintBuilder() string
- func (s *Service) Process() error
- func (s *Service) ProcessMethods() error
- type Services
- type SpannerStringer
- type SqlStringer
- type StreamType
- type Struct
- type 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) GetStructByProtoName(name string) *Struct
- type TypeDesc
- type UnaryStringer
- func (s *UnaryStringer) AfterHook()
- func (s *UnaryStringer) BeforeHook()
- func (s *UnaryStringer) HandleRow()
- func (s *UnaryStringer) Params()
- func (s *UnaryStringer) PersistCall()
- func (s *UnaryStringer) ResultFromRow()
- func (s *UnaryStringer) String() string
- func (s *UnaryStringer) Unimplemented() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatCode ¶
func FromScanableFuncName ¶ added in v1.0.0
func GetGoPackage ¶
GetGoPackage get a go import url under the following formats github.com/path/project/dir;package github.com/path/project/dir project/dir;package project/dir and will return the package name from url package dir package dir
func GetGoPath ¶
GetGoPath get a go import url under the following formats github.com/path/project/dir;package github.com/path/project/dir project/dir;package project/dir and will return the path portion from url: github.com/path/project/dir project/dir
func GetSpannerPersistLibTypeName ¶ added in v1.0.0
func GetSqlPersistLibTypeName ¶ added in v1.0.0
func IterPersistName ¶ added in v1.0.0
func IterProtoName ¶ added in v1.0.0
func IteratorHelper ¶ added in v1.0.0
func PersistLibTypeString ¶ added in v1.0.0
func SpannerType ¶ added in v1.0.0
func SpannerTypeFieldName ¶ added in v1.0.0
func ToParamsFuncName ¶ added in v1.0.0
Types ¶
type BackendStringer ¶ added in v1.0.0
type BidiStreamStringer ¶ added in v1.0.0
type BidiStreamStringer struct {
// contains filtered or unexported fields
}
func NewBidiStreamStringer ¶ added in v1.0.0
func NewBidiStreamStringer(method *Method, b BackendStringer) *BidiStreamStringer
func (*BidiStreamStringer) AfterHook ¶ added in v1.0.0
func (s *BidiStreamStringer) AfterHook()
func (*BidiStreamStringer) BeforeHook ¶ added in v1.0.0
func (s *BidiStreamStringer) BeforeHook()
func (*BidiStreamStringer) HandleRow ¶ added in v1.0.0
func (s *BidiStreamStringer) HandleRow()
func (*BidiStreamStringer) Params ¶ added in v1.0.0
func (s *BidiStreamStringer) Params()
func (*BidiStreamStringer) PersistCall ¶ added in v1.0.0
func (s *BidiStreamStringer) PersistCall()
func (*BidiStreamStringer) String ¶ added in v1.0.0
func (s *BidiStreamStringer) String() string
func (*BidiStreamStringer) Unimplemented ¶ added in v1.0.0
func (s *BidiStreamStringer) Unimplemented() string
type ClientStreamStringer ¶ added in v1.0.0
type ClientStreamStringer struct {
// contains filtered or unexported fields
}
func NewClientStreamStringer ¶ added in v1.0.0
func NewClientStreamStringer(method *Method, b BackendStringer) *ClientStreamStringer
func (*ClientStreamStringer) AfterHook ¶ added in v1.0.0
func (s *ClientStreamStringer) AfterHook()
func (*ClientStreamStringer) BeforeHook ¶ added in v1.0.0
func (s *ClientStreamStringer) BeforeHook()
func (*ClientStreamStringer) HandleRow ¶ added in v1.0.0
func (s *ClientStreamStringer) HandleRow()
func (*ClientStreamStringer) Params ¶ added in v1.0.0
func (s *ClientStreamStringer) Params()
func (*ClientStreamStringer) PersistCall ¶ added in v1.0.0
func (s *ClientStreamStringer) PersistCall()
func (*ClientStreamStringer) String ¶ added in v1.0.0
func (s *ClientStreamStringer) String() string
func (*ClientStreamStringer) Unimplemented ¶ added in v1.0.0
func (s *ClientStreamStringer) Unimplemented() string
type FileList ¶
type FileList []*FileStruct
func NewFileList ¶
func NewFileList() *FileList
func (*FileList) Append ¶
func (fl *FileList) Append(file *FileStruct)
func (*FileList) FindFile ¶
func (fl *FileList) FindFile(desc *descriptor.FileDescriptorProto) *FileStruct
func (*FileList) GetOrCreateFile ¶
func (fl *FileList) GetOrCreateFile(desc *descriptor.FileDescriptorProto, allStructs *StructList, dependency bool, params PersistOpts) *FileStruct
type FileStruct ¶
type FileStruct struct { Desc *descriptor.FileDescriptorProto ImportList *Imports Dependency bool // if is dependency Structures *StructList // all structures in the file AllStructures *StructList // all structures in all the files ServiceList *Services PersistStringer *PersistStringer // print our persist file Opts PersistOpts // options passed in via parameter }
func NewFileStruct ¶
func NewFileStruct( desc *descriptor.FileDescriptorProto, allStructs *StructList, dependency bool, opts PersistOpts) *FileStruct
func (*FileStruct) DifferentImpl ¶ added in v1.0.0
func (f *FileStruct) DifferentImpl() bool
func (*FileStruct) Generate ¶
func (f *FileStruct) Generate() ([]byte, error)
func (*FileStruct) GetFileName ¶
func (f *FileStruct) GetFileName() string
func (*FileStruct) GetFullGoPackage ¶ added in v1.0.0
func (f *FileStruct) GetFullGoPackage() string
func (*FileStruct) GetGoPackage ¶
func (f *FileStruct) GetGoPackage() string
func (*FileStruct) GetGoPath ¶
func (f *FileStruct) GetGoPath() string
func (*FileStruct) GetImplDir ¶ added in v1.0.0
func (f *FileStruct) GetImplDir() string
func (*FileStruct) GetImplFileName ¶ added in v1.0.0
func (f *FileStruct) GetImplFileName() string
func (*FileStruct) GetImplPackage ¶ added in v1.0.0
func (f *FileStruct) GetImplPackage() string
func (*FileStruct) GetOrigName ¶
func (f *FileStruct) GetOrigName() string
func (*FileStruct) GetPackageName ¶
func (f *FileStruct) GetPackageName() string
func (*FileStruct) GetPersistFile ¶ added in v1.0.0
func (f *FileStruct) GetPersistFile() string
return the computed persist file taking in consideration the persist.package option and original file name
func (*FileStruct) GetPersistLibFullFilepath ¶ added in v1.0.0
func (f *FileStruct) GetPersistLibFullFilepath() persistFile
func (*FileStruct) GetPersistPackageOption ¶ added in v1.0.0
func (f *FileStruct) GetPersistPackageOption() string
extract the persist.package file option or return "" as default
func (*FileStruct) GetServices ¶
func (f *FileStruct) GetServices() *Services
func (*FileStruct) IsSameAsMyPackage ¶ added in v1.0.0
func (f *FileStruct) IsSameAsMyPackage(pkg string) bool
func (*FileStruct) NeedImport ¶ added in v1.0.0
func (f *FileStruct) NeedImport(pkg string) bool
func (*FileStruct) NeedsPersistLibDir ¶ added in v1.0.0
func (f *FileStruct) NeedsPersistLibDir() bool
the generator may need to make an extra package in the directory beneath ours this library will not be imported by our persist code, so it is safe to use anywhere the client wants
func (*FileStruct) NotSameAsMyPackage ¶ added in v1.0.0
func (f *FileStruct) NotSameAsMyPackage(pkg string) bool
func (*FileStruct) Process ¶
func (f *FileStruct) Process() error
func (*FileStruct) ProcessImports ¶
func (f *FileStruct) ProcessImports()
func (*FileStruct) ProcessImportsForType ¶
func (f *FileStruct) ProcessImportsForType(name string)
func (*FileStruct) SanatizeImports ¶ added in v1.0.0
func (f *FileStruct) SanatizeImports()
type Generator ¶
type Generator struct { OriginalRequest *plugin_go.CodeGeneratorRequest AllStructures *StructList // all structures present in the files Files *FileList Response *plugin_go.CodeGeneratorResponse }
func NewGenerator ¶
func NewGenerator(request *plugin_go.CodeGeneratorRequest) *Generator
func (*Generator) GetResponse ¶
type GeneratorStruct ¶
type GeneratorStruct interface {
Generate() string
}
type GenericDescriptor ¶
type GenericDescriptor interface {
GetName() string
}
type Import ¶
func GetHookAndImports ¶ added in v1.0.0
func GetTypeMappingsAndImports ¶ added in v1.0.0
func GetTypeMappingsAndImports(*persist.TypeMapping) (string, []*Import)
type Imports ¶
type Imports []*Import
func EmptyImportList ¶
func EmptyImportList() *Imports
func (*Imports) GetGoNameByStruct ¶
func (*Imports) GetImportPkgForPath ¶
func (*Imports) GetOrAddImport ¶
type Method ¶
type Method struct { Desc *descriptor.MethodDescriptorProto Service *Service Query parser.Query // contains filtered or unexported fields }
func NewMethod ¶
func NewMethod(desc *descriptor.MethodDescriptorProto, srv *Service) (*Method, error)
func (*Method) DefaultMapping ¶
func (m *Method) DefaultMapping(typ *descriptor.FieldDescriptorProto) string
func (*Method) GetAfterHookName ¶
func (*Method) GetFilePackage ¶ added in v1.0.0
helper method for getting a files package for stream calls if the service.pb.go and the persist.go are in different packages it will return the import prefix+. of the package, otherwise it returns the empty string
func (*Method) GetGoTypeName ¶
func (*Method) GetGoTypeNameByFieldDesc ¶ added in v1.0.0
func (m *Method) GetGoTypeNameByFieldDesc(ty *descriptor.FieldDescriptorProto) string
func (*Method) GetInputType ¶
func (*Method) GetInputTypeMinusPackage ¶ added in v1.0.0
returns the last element of the type. So instead of test.ExampleTable, it returns ExampleTable
func (*Method) GetInputTypeStruct ¶
func (*Method) GetMappedType ¶
func (m *Method) GetMappedType(typ *descriptor.FieldDescriptorProto) string
GetMappedType return mapped type's package + type for a mapped proto, otherwise it returns the default type data
func (*Method) GetMapping ¶
func (m *Method) GetMapping(typ *descriptor.FieldDescriptorProto) *persist.TypeMapping_TypeDescriptor
func (*Method) GetMethodOption ¶
func (*Method) GetOutputType ¶
func (*Method) GetOutputTypeMinusPackage ¶ added in v1.0.0
returns the last element of the type. So instead of test.ExampleTable, it returns ExampleTable
func (*Method) GetOutputTypeStruct ¶
func (*Method) GetTypeDescArrayForStruct ¶
func (*Method) GetTypeDescForFieldsInStruct ¶
func (*Method) GetTypeDescForFieldsInStructSnakeCase ¶
func (*Method) GetTypeDescForQueryFields ¶ added in v1.0.0
func (*Method) GetTypeMappingOpts ¶ added in v1.0.0
func (m *Method) GetTypeMappingOpts() *persist.TypeMapping
returns the type mapping option on either the method, or the service.
func (*Method) GetTypeStructByProtoName ¶
func (*Method) IsBidiStreaming ¶
func (*Method) IsClientStreaming ¶
func (*Method) IsServerStreaming ¶
type Methods ¶
type Methods []*Method
func (*Methods) AddMethod ¶
func (m *Methods) AddMethod(desc *descriptor.MethodDescriptorProto, service *Service) error
func (*Methods) PreGenerate ¶
type PLInputName ¶ added in v1.0.0
type PLInputName struct {
// contains filtered or unexported fields
}
func NewPLInputName ¶ added in v1.0.0
func NewPLInputName(m *Method) PLInputName
name of the structs that are inputs to a method these need to be specific to the package and service. Each service can have their own type mapping of the same message. if the mappings of a message don't match then they will override eachother unless they are specific to the service.
func (PLInputName) String ¶ added in v1.0.0
func (p PLInputName) String() string
type PLOutputName ¶ added in v1.0.0
type PLOutputName struct {
// contains filtered or unexported fields
}
func NewPLOutputName ¶ added in v1.0.0
func NewPLOutputName(m *Method) PLOutputName
func (PLOutputName) String ¶ added in v1.0.0
func (p PLOutputName) String() string
type PLQueryMethodName ¶ added in v1.0.0
type PLQueryMethodName struct {
// contains filtered or unexported fields
}
the method name that returns our stringed query
func NewPLQueryMethodName ¶ added in v1.0.0
func NewPLQueryMethodName(m *Method) PLQueryMethodName
func (PLQueryMethodName) String ¶ added in v1.0.0
func (pl PLQueryMethodName) String() string
type PackagePath ¶ added in v1.0.0
type PackagePath string
just a string, but represents the path that these persist files will live in
type PersistContent ¶ added in v1.0.0
type PersistContent struct { Content string // the contents that belong in the code generator response Name string // the filename for the response }
func GenerateFilePersistHandlerContent ¶ added in v1.0.0
func GenerateFilePersistHandlerContent(pkg PackagePath, file *FileStruct) PersistContent
func GenerateFileQueryContent ¶ added in v1.0.0
func GenerateFileQueryContent(pkg PackagePath, file *FileStruct) PersistContent
func GeneratePkgLevelContent ¶ added in v1.0.0
func GeneratePkgLevelContent(pkg PackagePath, files []*FileStruct) PersistContent
type PersistHandlerName ¶ added in v1.0.0
type PersistHandlerName struct {
// contains filtered or unexported fields
}
name of the handler on the persist helper struct
func NewPersistHandlerName ¶ added in v1.0.0
func NewPersistHandlerName(m *Method) PersistHandlerName
func (PersistHandlerName) String ¶ added in v1.0.0
func (p PersistHandlerName) String() string
type PersistHelperName ¶ added in v1.0.0
type PersistHelperName struct {
// contains filtered or unexported fields
}
name of the method reciever struct in the persist lib implements all persist methods on a service
func NewPersistHelperName ¶ added in v1.0.0
func NewPersistHelperName(s *Service) PersistHelperName
func (PersistHelperName) String ¶ added in v1.0.0
func (p PersistHelperName) String() string
type PersistOpts ¶ added in v1.0.0
func ParseCommandLine ¶ added in v1.0.0
func ParseCommandLine(str string) PersistOpts
type PersistPackage ¶ added in v1.0.0
type PersistPackage struct {
// contains filtered or unexported fields
}
func NewPersistPackage ¶ added in v1.0.0
func NewPersistPackage(fileList *FileList) *PersistPackage
func (*PersistPackage) Generate ¶ added in v1.0.0
func (p *PersistPackage) Generate() []PersistContent
type PersistStringer ¶ added in v1.0.0
type PersistStringer struct{}
func (*PersistStringer) DeclareSpannerGetter ¶ added in v1.0.0
func (per *PersistStringer) DeclareSpannerGetter() string
func (*PersistStringer) DeclareSqlPackageDefs ¶ added in v1.0.0
func (per *PersistStringer) DeclareSqlPackageDefs() string
package level definitions for sql implemented libraries SqlClientGetter Scanable interface Runable interface Result struct
func (*PersistStringer) DefaultFunctionsImpl ¶ added in v1.0.0
func (per *PersistStringer) DefaultFunctionsImpl(service *Service) string
func (*PersistStringer) DefaultSpannerFunctionsImpl ¶ added in v1.0.0
func (per *PersistStringer) DefaultSpannerFunctionsImpl(method *Method) string
func (*PersistStringer) DefaultSqlFunctionsImpl ¶ added in v1.0.0
func (per *PersistStringer) DefaultSqlFunctionsImpl(method *Method) string
func (*PersistStringer) HandlersStructDeclaration ¶ added in v1.0.0
func (per *PersistStringer) HandlersStructDeclaration(service *Service) string
func (*PersistStringer) HelperFunctionImpl ¶ added in v1.0.0
func (per *PersistStringer) HelperFunctionImpl(service *Service) string
func (*PersistStringer) MessageInputDeclaration ¶ added in v1.0.0
func (per *PersistStringer) MessageInputDeclaration(method *Method) string
func (*PersistStringer) PersistImplBuilder ¶ added in v1.0.0
func (per *PersistStringer) PersistImplBuilder(service *Service) string
HOOKCHANGE merges custom defined handlers with our own
func (*PersistStringer) QueryInterfaceDefinition ¶ added in v1.0.0
func (per *PersistStringer) QueryInterfaceDefinition(method *Method) string
func (*PersistStringer) SpannerQueryFunction ¶ added in v1.0.0
func (per *PersistStringer) SpannerQueryFunction(method *Method) string
func (*PersistStringer) SqlQueryFunction ¶ added in v1.0.0
func (per *PersistStringer) SqlQueryFunction(method *Method) string
type Printer ¶ added in v1.0.0
type Printer struct {
// contains filtered or unexported fields
}
type ServerStreamStringer ¶ added in v1.0.0
type ServerStreamStringer struct {
// contains filtered or unexported fields
}
func NewServerStreamStringer ¶ added in v1.0.0
func NewServerStreamStringer(method *Method, b BackendStringer) *ServerStreamStringer
func (*ServerStreamStringer) AfterHook ¶ added in v1.0.0
func (s *ServerStreamStringer) AfterHook()
func (*ServerStreamStringer) BeforeHook ¶ added in v1.0.0
func (s *ServerStreamStringer) BeforeHook()
func (*ServerStreamStringer) HandleRow ¶ added in v1.0.0
func (s *ServerStreamStringer) HandleRow()
func (*ServerStreamStringer) Params ¶ added in v1.0.0
func (s *ServerStreamStringer) Params()
func (*ServerStreamStringer) PersistCall ¶ added in v1.0.0
func (s *ServerStreamStringer) PersistCall()
func (*ServerStreamStringer) ResultFromRow ¶ added in v1.0.0
func (s *ServerStreamStringer) ResultFromRow()
func (*ServerStreamStringer) String ¶ added in v1.0.0
func (s *ServerStreamStringer) String() string
func (*ServerStreamStringer) Unimplemented ¶ added in v1.0.0
func (s *ServerStreamStringer) Unimplemented() string
type Service ¶
type Service struct { Desc *descriptor.ServiceDescriptorProto Methods *Methods Package string // protobuf package File *FileStruct AllStructs *StructList }
func (*Service) GetServiceOption ¶
func (s *Service) GetServiceOption() *persist.TypeMapping
func (*Service) GetServiceType ¶
func (s *Service) GetServiceType() *persist.PersistenceOptions
func (*Service) PrintBuilder ¶ added in v1.0.0
func (*Service) ProcessMethods ¶
type Services ¶
type Services []*Service
func (*Services) AddService ¶
func (s *Services) AddService(pkg string, desc *descriptor.ServiceDescriptorProto, allStructs *StructList, file *FileStruct) *Service
func (Services) HasPersistService ¶ added in v1.0.0
we are a persist service if we have persist options. meaning we are either spanner or sql
func (*Services) PreGenerate ¶
type SpannerStringer ¶ added in v1.0.0
type SpannerStringer struct {
// contains filtered or unexported fields
}
func (*SpannerStringer) MapRequestToParams ¶ added in v1.0.0
func (s *SpannerStringer) MapRequestToParams() string
func (*SpannerStringer) RowType ¶ added in v1.0.0
func (s *SpannerStringer) RowType() string
func (*SpannerStringer) TranslateRowToResult ¶ added in v1.0.0
func (s *SpannerStringer) TranslateRowToResult() string
type SqlStringer ¶ added in v1.0.0
type SqlStringer struct {
// contains filtered or unexported fields
}
func (*SqlStringer) MapRequestToParams ¶ added in v1.0.0
func (s *SqlStringer) MapRequestToParams() string
func (*SqlStringer) RowType ¶ added in v1.0.0
func (s *SqlStringer) RowType() string
func (*SqlStringer) TranslateRowToResult ¶ added in v1.0.0
func (s *SqlStringer) TranslateRowToResult() string
type StreamType ¶ added in v1.0.0
type StreamType struct {
// contains filtered or unexported fields
}
the stream struct name used by streaming grpc methods
func NewStreamType ¶ added in v1.0.0
func NewStreamType(m *Method) StreamType
func (StreamType) String ¶ added in v1.0.0
func (s StreamType) String() string
type Struct ¶
type Struct struct { Descriptor GenericDescriptor Package string ParentDescriptor *Struct IsMessage bool IsInnerType bool File *FileStruct // for determine go import path and go package EnumDesc *desc.EnumDescriptorProto MsgDesc *desc.DescriptorProto }
func (*Struct) GetFieldType ¶
func (s *Struct) GetFieldType(field string) *desc.FieldDescriptorProto
func (*Struct) GetImportedFiles ¶
func (*Struct) GetProtoName ¶
type StructList ¶
type StructList []*Struct
func NewStructList ¶
func NewStructList() *StructList
func (*StructList) AddEnum ¶
func (s *StructList) AddEnum(enum *desc.EnumDescriptorProto, parent *Struct, pkg string, file *FileStruct) *Struct
func (*StructList) AddMessage ¶
func (s *StructList) AddMessage(message *desc.DescriptorProto, parent *Struct, pkg string, file *FileStruct) *Struct
func (*StructList) Append ¶
func (s *StructList) Append(struc *Struct)
func (*StructList) GetStructByFieldDesc ¶
func (s *StructList) GetStructByFieldDesc(fld *desc.FieldDescriptorProto) *Struct
func (*StructList) GetStructByProtoName ¶
func (s *StructList) GetStructByProtoName(name string) *Struct
type TypeDesc ¶
type TypeDesc struct { Name string // ex. StartTime ProtoName string // start_time // mytime.MyTime (if it is mapped) otherwise is defaultMapping ex: string, []float64 // if is a message type, then *pb.TestMessage []*TestMessage GoName string GoTypeName string OrigGoName string // Timestamp Struct *Struct Mapping *persist.TypeMapping_TypeDescriptor IsMapped bool IsRepeated bool IsEnum bool IsMessage bool ResultHook bool FieldDescriptor *descriptor.FieldDescriptorProto // spanner.GenericColumnValue, spanner.NullString, spanner.NullInt64 // or if just the GoName SpannerType string // name used as field in the spanner.Null* types. ex: StringVal, NullInt64 SpannerTypeFieldName string // if our spannerType != GoName, we need to convert our message NeedsSpannerConversion bool }
type UnaryStringer ¶ added in v1.0.0
type UnaryStringer struct {
// contains filtered or unexported fields
}
func NewUnaryStringer ¶ added in v1.0.0
func NewUnaryStringer(method *Method, b BackendStringer) *UnaryStringer
func (*UnaryStringer) AfterHook ¶ added in v1.0.0
func (s *UnaryStringer) AfterHook()
func (*UnaryStringer) HandleRow ¶ added in v1.0.0
func (s *UnaryStringer) HandleRow()
func (*UnaryStringer) Params ¶ added in v1.0.0
func (s *UnaryStringer) Params()
func (*UnaryStringer) PersistCall ¶ added in v1.0.0
func (s *UnaryStringer) PersistCall()
func (*UnaryStringer) ResultFromRow ¶ added in v1.0.0
func (s *UnaryStringer) ResultFromRow()
func (*UnaryStringer) String ¶ added in v1.0.0
func (s *UnaryStringer) String() string
func (*UnaryStringer) Unimplemented ¶ added in v1.0.0
func (s *UnaryStringer) Unimplemented() string