Documentation
¶
Index ¶
- Constants
- func NewExtendedSheetParser(ctx context.Context, protoPackage, locationName string, ...) *sheetParser
- func NewSheetExporter(outputDir string, output *options.ConfOutputOption, ...) *sheetExporter
- func NewSheetParser(ctx context.Context, protoPackage, locationName string, ...) *sheetParser
- func NewValidator(prFiles *protoregistry.Files) (protovalidate.Validator, error)
- func ParseFileOptions(fd protoreflect.FileDescriptor) (string, *tableaupb.WorkbookOptions)
- func ParseMessage(info *SheetInfo, collector *xerrors.Collector, ...) (proto.Message, error)
- func ParseMessageOptions(md protoreflect.MessageDescriptor) (string, *tableaupb.WorksheetOptions)
- func PrintPerfStats(gen *Generator)
- func Validate(msg proto.Message, validator protovalidate.Validator) error
- type Field
- type Generator
- type SheetInfo
- type SheetParserExtInfo
Constants ¶
View Source
const Version = "0.10.0"
Variables ¶
This section is empty.
Functions ¶
func NewExtendedSheetParser ¶ added in v0.11.0
func NewExtendedSheetParser(ctx context.Context, protoPackage, locationName string, bookOpts *tableaupb.WorkbookOptions, sheetOpts *tableaupb.WorksheetOptions, extInfo *SheetParserExtInfo) *sheetParser
NewExtendedSheetParser creates a new sheet parser with extended info.
func NewSheetExporter ¶
func NewSheetExporter(outputDir string, output *options.ConfOutputOption, validator protovalidate.Validator, collector *xerrors.Collector) *sheetExporter
NewSheetExporter creates a new sheet exporter.
func NewSheetParser ¶
func NewSheetParser(ctx context.Context, protoPackage, locationName string, opts *tableaupb.WorksheetOptions) *sheetParser
NewSheetParser creates a new sheet parser.
func NewValidator ¶ added in v0.16.3
func NewValidator(prFiles *protoregistry.Files) (protovalidate.Validator, error)
NewValidator creates a protovalidate validator whose extension type resolver is built from prFiles, so custom predefined rules can be recognized. It is shared by both the confgen (generate) and load (checker) paths to keep validation behavior consistent.
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 ParseMessage(info *SheetInfo, collector *xerrors.Collector, impInfos ...importer.ImporterInfo) (proto.Message, error)
ParseMessage parses multiple importer infos into one protomsg.
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.
// Performance stats
PerfStats sync.Map
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGeneratorWithOptions ¶ added in v0.9.14
func (*Generator) GenWorkbook ¶ added in v0.10.0
bookSpecifier can be:
- only workbook: excel/Item.xlsx
- with worksheet: excel/Item.xlsx#Item (To be implemented)
type SheetInfo ¶ added in v0.10.7
type SheetInfo struct {
ProtoPackage string
LocationName string
PrimaryBookName string
MD protoreflect.MessageDescriptor
BookOpts *tableaupb.WorkbookOptions
SheetOpts *tableaupb.WorksheetOptions
ExtInfo *SheetParserExtInfo
}
func (*SheetInfo) HasScatter ¶ added in v0.10.7
Source Files
¶
Click to show internal directories.
Click to hide internal directories.