confgen

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.8.2"

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) *sheetExporter

func NewSheetParser

func NewSheetParser(ctx context.Context, protoPackage, locationName string, opts *tableaupb.WorksheetOptions) *sheetParser

NewSheetParser creates a new sheet parser.

func ParseFileOptions added in v0.9.0

ParseFileOptions parse the options of a protobuf definition file.

func ParseMessage added in v0.10.5

func ParseMessage(info *SheetInfo, impInfos ...importer.ImporterInfo) (proto.Message, error)

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

ParseMessageOptions parse the options of a protobuf message.

func PrintPerfStats added in v0.10.0

func PrintPerfStats(gen *Generator)

Types

type Field

type Field struct {
	// contains filtered or unexported fields
}

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 NewGenerator(protoPackage, indir, outdir string, setters ...options.Option) *Generator

func NewGeneratorWithOptions added in v0.9.14

func NewGeneratorWithOptions(protoPackage, indir, outdir string, opts *options.Options) *Generator

func (*Generator) GenAll added in v0.10.0

func (gen *Generator) GenAll() error

func (*Generator) GenWorkbook added in v0.10.0

func (gen *Generator) GenWorkbook(bookSpecifiers ...string) error

bookSpecifier can be:

  • only workbook: excel/Item.xlsx
  • with worksheet: excel/Item.xlsx#Item (To be implemented)

func (*Generator) Generate

func (gen *Generator) Generate(bookSpecifiers ...string) (err error)

bookSpecifier can be:

  • only workbook: excel/Item.xlsx
  • specific 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) HasMerger added in v0.10.7

func (si *SheetInfo) HasMerger() bool

func (*SheetInfo) HasScatter added in v0.10.7

func (si *SheetInfo) HasScatter() bool

type SheetParserExtInfo added in v0.11.0

type SheetParserExtInfo struct {
	InputDir       string
	SubdirRewrites map[string]string
	PRFiles        *protoregistry.Files
	BookFormat     format.Format // workbook format
	DryRun         options.DryRun
}

SheetParserExtInfo is the extended info for refer check and so on.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL