Documentation ¶
Index ¶
- Constants
- func AppVersion() string
- func GetOneofFieldByNumber(od protoreflect.OneofDescriptor, n int32) protoreflect.FieldDescriptor
- func IsUnion(md protoreflect.MessageDescriptor) bool
- func IsUnionField(fd protoreflect.FieldDescriptor) bool
- func NewSheetExporter(outputDir string, output *options.ConfOutputOption) *sheetExporter
- func NewSheetParser(protoPackage, locationName string, opts *tableaupb.WorksheetOptions) *sheetParser
- func ParseFileOptions(fd protoreflect.FileDescriptor) (string, *tableaupb.WorkbookOptions)
- func ParseMessage(info *SheetInfo, importers ...importer.Importer) (proto.Message, error)
- func ParseMessageOptions(md protoreflect.MessageDescriptor) (string, *tableaupb.WorksheetOptions)
- func PrintPerfStats(gen *Generator)
- type Field
- type Generator
- type SheetInfo
- type UnionDescriptor
Constants ¶
View Source
const ( App = "confgen" Version = "0.5.0" )
Variables ¶
This section is empty.
Functions ¶
func AppVersion ¶ added in v0.10.2
func AppVersion() string
func GetOneofFieldByNumber ¶ added in v0.10.7
func GetOneofFieldByNumber(od protoreflect.OneofDescriptor, n int32) protoreflect.FieldDescriptor
GetOneofFieldByNumber returns the FieldDescriptor for a field numbered n. It returns nil if not found.
func IsUnion ¶ added in v0.10.7
func IsUnion(md protoreflect.MessageDescriptor) bool
func IsUnionField ¶ added in v0.10.7
func IsUnionField(fd protoreflect.FieldDescriptor) bool
func NewSheetExporter ¶
func NewSheetExporter(outputDir string, output *options.ConfOutputOption) *sheetExporter
func NewSheetParser ¶
func NewSheetParser(protoPackage, locationName string, opts *tableaupb.WorksheetOptions) *sheetParser
NewSheetParser create a new sheet parser without Generator.
func ParseFileOptions ¶ added in v0.9.0
func ParseFileOptions(fd protoreflect.FileDescriptor) (string, *tableaupb.WorkbookOptions)
ParseFileOptions parse the options of a protobuf definition file.
func ParseMessage ¶ added in v0.10.5
func ParseMessageOptions ¶ added in v0.9.0
func ParseMessageOptions(md protoreflect.MessageDescriptor) (string, *tableaupb.WorksheetOptions)
ParseMessageOptions parse the options of a protobuf message.
func PrintPerfStats ¶ added in v0.10.0
func PrintPerfStats(gen *Generator)
Types ¶
type Generator ¶
type Generator struct { ProtoPackage string // protobuf package name. InputDir string // input dir of workbooks. OutputDir string // output dir of generated files. LocationName string // TZ location name. InputOpt *options.ConfInputOption // Input settings. OutputOpt *options.ConfOutputOption // output settings. // Performace stats PerfStats sync.Map // contains filtered or unexported fields }
func NewGenerator ¶
func NewGeneratorWithOptions ¶ added in v0.9.14
func (*Generator) GenOneWorkbook ¶ added in v0.10.0
func (*Generator) GenWorkbook ¶ added in v0.10.0
type SheetInfo ¶ added in v0.10.7
type SheetInfo struct { ProtoPackage string LocationName string MD protoreflect.MessageDescriptor Opts *tableaupb.WorksheetOptions // contains filtered or unexported fields }
func NewSheetInfo ¶ added in v0.10.7
func NewSheetInfo(protoPackage, locationName string, md protoreflect.MessageDescriptor, opts *tableaupb.WorksheetOptions) *SheetInfo
func (*SheetInfo) HasScatter ¶ added in v0.10.7
type UnionDescriptor ¶ added in v0.10.7
type UnionDescriptor struct { Type protoreflect.FieldDescriptor Value protoreflect.OneofDescriptor }
func ExtractUnionDescriptor ¶ added in v0.10.7
func ExtractUnionDescriptor(md protoreflect.MessageDescriptor) *UnionDescriptor
func (UnionDescriptor) GetValueByNumber ¶ added in v0.10.7
func (u UnionDescriptor) GetValueByNumber(n int32) protoreflect.FieldDescriptor
GetValueByNumber returns the FieldDescriptor for a field numbered n. It returns nil if not found.
func (UnionDescriptor) TypeName ¶ added in v0.10.7
func (u UnionDescriptor) TypeName() string
TypeName returns the type field name. It returns CameCase style of proto field name if not set explicitly in field extension.
func (UnionDescriptor) ValueFieldName ¶ added in v0.10.7
func (u UnionDescriptor) ValueFieldName() string
ValueFieldName returns the value field name. It returns "Field" if not set explicitly in oneof extension.
Click to show internal directories.
Click to hide internal directories.