Documentation
¶
Index ¶
- Constants
- func NewExtendedSheetParser(protoPackage, locationName string, opts *tableaupb.WorksheetOptions, ...) *sheetParser
- 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, impInfos ...importer.ImporterInfo) (proto.Message, error)
- func ParseMessageOptions(md protoreflect.MessageDescriptor) (string, *tableaupb.WorksheetOptions)
- func PrintPerfStats(gen *Generator)
- type Field
- type Generator
- type SheetInfo
- type SheetParserExtInfo
Constants ¶
View Source
const Version = "0.7.1"
Variables ¶
This section is empty.
Functions ¶
func NewExtendedSheetParser ¶ added in v0.11.0
func NewExtendedSheetParser(protoPackage, locationName string, opts *tableaupb.WorksheetOptions, extInfo *SheetParserExtInfo) *sheetParser
NewExtendedSheetParser creates a new sheet parser with extended info.
func NewSheetExporter ¶
func NewSheetExporter(outputDir string, output *options.ConfOutputOption) *sheetExporter
func NewSheetParser ¶
func NewSheetParser(protoPackage, locationName string, opts *tableaupb.WorksheetOptions) *sheetParser
NewSheetParser creates a new sheet parser.
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
ParseMessage parses multiple importer infos into one protomsg. If an error occurs, then wrap it with KeyModule as ModuleConf ("confgen"), then API user can call `xerrors.NewDesc(err)“ to print the pretty error message.
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
}
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
Opts *tableaupb.WorksheetOptions
ExtInfo *SheetParserExtInfo
}
func (*SheetInfo) HasScatter ¶ added in v0.10.7
type SheetParserExtInfo ¶ added in v0.11.0
type SheetParserExtInfo struct {
InputDir string
SubdirRewrites map[string]string
Sep string // global-level separator, generally set by options.ConfInputOption.Sep
Subsep string // global-level subseparator, generally set by options.ConfInputOption.Subsep
PRFiles *protoregistry.Files
BookFormat format.Format // workbook format
DryRun options.DryRun
}
SheetParserExtInfo is the extended info for refer check and so on.
Click to show internal directories.
Click to hide internal directories.