Documentation ¶
Index ¶
- Constants
- Variables
- func CqlKind(d protoreflect.FieldDescriptor) string
- func CrcHash(data []byte) uint64
- func ExecTemplate(t *template.Template, v interface{}) string
- func GoKind(d protoreflect.FieldDescriptor) string
- func ZeroValue(f protoreflect.FieldDescriptor) string
- type ConstructorFormat
- type FieldArg
- func (fa FieldArg) DescName() string
- func (fa FieldArg) JSONName() string
- func (fa FieldArg) Name() string
- func (fa FieldArg) NameCC() string
- func (fa FieldArg) NameKC() string
- func (fa FieldArg) NameSC() string
- func (fa FieldArg) Options() *descriptorpb.FieldOptions
- func (fa FieldArg) Pkg() string
- func (fa FieldArg) Type() string
- func (fa FieldArg) With(f *protogen.File) FieldArg
- type Generator
- type GeneratorFunc
- type Language
- type MessageArg
- func (ma MessageArg) CName() string
- func (ma MessageArg) Fullname() string
- func (ma MessageArg) IsEnvelope() bool
- func (ma MessageArg) Name() string
- func (ma MessageArg) NameCC() string
- func (ma MessageArg) NameKC() string
- func (ma MessageArg) NameSC() string
- func (ma MessageArg) Options() *descriptorpb.MessageOptions
- func (ma MessageArg) Pkg() string
- func (ma MessageArg) SkipJson() bool
- func (ma MessageArg) ViewsByPK() map[string][]*ModelKey
- func (ma MessageArg) With(f *protogen.File) MessageArg
- type MethodArg
- type ModelKey
- func (m *ModelKey) Alias() string
- func (m *ModelKey) CKs() []Prop
- func (m *ModelKey) ClusteringKeys() []Prop
- func (m *ModelKey) HasProp(name string) bool
- func (m *ModelKey) Index() int
- func (m *ModelKey) IsSubset(n *ModelKey) bool
- func (m *ModelKey) Keys() []Prop
- func (m *ModelKey) Name() string
- func (m *ModelKey) NameTypes(filter PropFilter, namePrefix string, nameCase TextCase, lang Language) string
- func (m *ModelKey) Names(filter PropFilter, prefix, postfix string, sep string, nameCase TextCase) string
- func (m *ModelKey) PKs() []Prop
- func (m *ModelKey) PartitionKeys() []Prop
- type Order
- type PluginOptions
- type Prop
- type PropFilter
- type RestArg
- type ServiceArg
- type TemplateArg
- type TextCase
Constants ¶
const ( PropFilterALL = "ALL" PropFilterPKs = "PKs" PropFilterCKs = "CKs" )
Variables ¶
var ( CrcBits = 64 CrcTab = crc64.MakeTable(crc64.ISO) )
var ( Commit = "3469a5f8bde0a47e94178e1a8bde953de8309bdc" Version = "v0.16.24" )
Functions ¶
func CqlKind ¶
func CqlKind(d protoreflect.FieldDescriptor) string
func ExecTemplate ¶ added in v0.14.3
func GoKind ¶
func GoKind(d protoreflect.FieldDescriptor) string
func ZeroValue ¶
func ZeroValue(f protoreflect.FieldDescriptor) string
ZeroValue returns the equal zero value based on the input type
Types ¶
type ConstructorFormat ¶ added in v0.14.6
type ConstructorFormat string
const ( StringJSON ConstructorFormat = "str" Int64JSON ConstructorFormat = "int64" )
type FieldArg ¶
type FieldArg struct { ImportPath protogen.GoImportPath ZeroValue string Kind string ProtoKind protoreflect.Kind ProtoCardinality protoreflect.Cardinality GoKind string CqlKind string Cardinality string HasIndex bool HelpText string DefaultValue string // contains filtered or unexported fields }
FieldArg holds the data needed by the template engine to generate code based on the protogen.Field
func (FieldArg) Options ¶ added in v0.14.13
func (fa FieldArg) Options() *descriptorpb.FieldOptions
type Generator ¶ added in v0.14.13
type Generator interface {
Generate(out *protogen.GeneratedFile, in ...*protogen.File) error
}
type GeneratorFunc ¶ added in v0.14.13
type GeneratorFunc func(out *protogen.GeneratedFile, in ...*protogen.File) error
func (GeneratorFunc) Generate ¶ added in v0.14.13
func (f GeneratorFunc) Generate(out *protogen.GeneratedFile, in ...*protogen.File) error
type MessageArg ¶
type MessageArg struct { Fields []FieldArg C uint64 ImportPath protogen.GoImportPath Comments string // If message is representing a model then following parameters are filled IsAggregate bool IsSingleton bool GlobalRepo string LocalRepo string Table *ModelKey TableExtra []Prop Views []*ModelKey // contains filtered or unexported fields }
MessageArg holds the data needed by the template engine to generate code based on the protogen.Message
func GetMessageArg ¶
func GetMessageArg(m *protogen.Message) MessageArg
func (MessageArg) CName ¶
func (ma MessageArg) CName() string
func (MessageArg) Fullname ¶
func (ma MessageArg) Fullname() string
func (MessageArg) IsEnvelope ¶ added in v0.15.2
func (ma MessageArg) IsEnvelope() bool
func (MessageArg) Name ¶
func (ma MessageArg) Name() string
func (MessageArg) NameCC ¶
func (ma MessageArg) NameCC() string
func (MessageArg) NameKC ¶ added in v0.12.0
func (ma MessageArg) NameKC() string
func (MessageArg) NameSC ¶ added in v0.12.0
func (ma MessageArg) NameSC() string
func (MessageArg) Options ¶ added in v0.14.13
func (ma MessageArg) Options() *descriptorpb.MessageOptions
func (MessageArg) Pkg ¶
func (ma MessageArg) Pkg() string
func (MessageArg) SkipJson ¶ added in v0.16.3
func (ma MessageArg) SkipJson() bool
func (MessageArg) ViewsByPK ¶ added in v0.12.0
func (ma MessageArg) ViewsByPK() map[string][]*ModelKey
func (MessageArg) With ¶ added in v0.12.30
func (ma MessageArg) With(f *protogen.File) MessageArg
type MethodArg ¶
type MethodArg struct { C uint64 Comments string Input MessageArg Output MessageArg RestEnabled bool TunnelOnly bool Rest RestArg // contains filtered or unexported fields }
MethodArg holds the data needed by the template engine to generate code based on the protogen.Method
func (MethodArg) Options ¶ added in v0.14.13
func (ma MethodArg) Options() *descriptorpb.MethodOptions
type ModelKey ¶
type ModelKey struct { Arg *MessageArg // contains filtered or unexported fields }
func (*ModelKey) ClusteringKeys ¶
func (*ModelKey) NameTypes ¶
func (m *ModelKey) NameTypes(filter PropFilter, namePrefix string, nameCase TextCase, lang Language) string
NameTypes is kind of strings.Join function which returns a custom format of combination of model properties. This is a helper function used in code generator templates.
func (*ModelKey) Names ¶
func (m *ModelKey) Names(filter PropFilter, prefix, postfix string, sep string, nameCase TextCase) string
Names is kind of strings.Join function which returns a custom format of property names. This is a helper function used in code generator templates.
func (*ModelKey) PartitionKeys ¶
type PluginOptions ¶ added in v0.12.30
type PluginOptions struct { NoEdgeDependency bool CRC32 bool ConstructorFormat ConstructorFormat OpenAPI bool ExportCleanProto bool }
func (*PluginOptions) ParamFunc ¶ added in v0.12.30
func (op *PluginOptions) ParamFunc(key, value string) error
type PropFilter ¶
type PropFilter string
type ServiceArg ¶
type ServiceArg struct { C uint64 Methods []MethodArg Comments string HasRestProxy bool // contains filtered or unexported fields }
ServiceArg holds the data needed by the template engine to generate code based on the protogen.Service
func (ServiceArg) Name ¶
func (sa ServiceArg) Name() string
func (ServiceArg) NameCC ¶
func (sa ServiceArg) NameCC() string
func (ServiceArg) NameKC ¶
func (sa ServiceArg) NameKC() string
func (ServiceArg) NameSC ¶ added in v0.12.30
func (sa ServiceArg) NameSC() string
func (ServiceArg) Options ¶ added in v0.14.13
func (sa ServiceArg) Options() *descriptorpb.ServiceOptions
func (ServiceArg) With ¶ added in v0.12.30
func (sa ServiceArg) With(f *protogen.File) ServiceArg
type TemplateArg ¶ added in v0.14.13
type TemplateArg struct { Messages []MessageArg Services []ServiceArg }
func GenTemplateArg ¶ added in v0.14.13
func GenTemplateArg(f *protogen.File) *TemplateArg