confgen

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

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 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

ParseFileOptions parse the options of a protobuf definition file.

func ParseMessage added in v0.10.5

func ParseMessage(info *SheetInfo, importers ...importer.Importer) (proto.Message, error)

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.

	// Performace 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) GenOneWorkbook added in v0.10.0

func (gen *Generator) GenOneWorkbook(relWorkbookPath string, worksheetName string) (err error)

func (*Generator) GenWorkbook added in v0.10.0

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

func (*Generator) Generate

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

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) 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 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.

Directories

Path Synopsis
mexporter is the message exporter package, which can export one single message to different formts: JSON, Text, and Bin.
mexporter is the message exporter package, which can export one single message to different formts: JSON, Text, and Bin.

Jump to

Keyboard shortcuts

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