tableau

package module
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: 10 Imported by: 0

README

Tableau

Modern Configuration Converter

Release Status Testing Status Code Coverage GitHub release (latest SemVer including pre-releases) go.dev GitHub

Tableau

A modern configuration converter based on Protobuf (proto3).

Features

  • Convert Excel/CSV/XML to JSON/Text/Bin, JSON is the first-class citizen of exporting targets.
  • Use Protobuf to define the structure of Excel/CSV/XML.
  • Use Golang to develop the conversion engine.
  • Support multiple programming languages, thanks to Protobuf (proto3).

Concepts

  • Importer: Excel/CSV/XML importer.
  • IR: Intermediate Representation.
  • Filter: filter the IR.
  • Exporter: JSON, Text, and Bin.
  • Protoconf: a dialect of Protobuf (proto3) extended with tableau options, also a conversion spec with expressive, elegant syntax.

Design

See official document: Design.

Contribution

Requirements
Protobuf

Goto Protocol Buffers v21.12, choose and download the correct platform of protoc, then install by README.

protoc-gen-go

Install: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenConf added in v0.9.6

func GenConf(protoPackage, indir, outdir string, setters ...options.Option) error

GenConf can convert Excel/CSV/XML files to different configuration files: JSON, Text, and Bin.

func GenProto added in v0.9.6

func GenProto(protoPackage, indir, outdir string, setters ...options.Option) (err error)

GenProto can convert Excel/CSV/XML files to protoconf files.

func Generate added in v0.9.14

func Generate(protoPackage, indir, outdir string, setters ...options.Option) error

Generate can convert Excel/CSV/XML files to protoconf files and different configuration files: JSON, Text, and Bin at the same time.

func NewConfGenerator added in v0.10.6

func NewConfGenerator(protoPackage, indir, outdir string, options ...options.Option) *confgen.Generator

NewConfGenerator creates a new conf generator.

func NewConfGeneratorWithOptions added in v0.10.6

func NewConfGeneratorWithOptions(protoPackage, indir, outdir string, options *options.Options) *confgen.Generator

NewConfGeneratorWithOptions creates a new conf generator with options.

func NewImporter added in v0.10.6

func NewImporter(workbookPath string) (importer.Importer, error)

NewImporter creates a new importer of the specified workbook.

func NewProtoGenerator added in v0.10.6

func NewProtoGenerator(protoPackage, indir, outdir string, options ...options.Option) *protogen.Generator

NewProtoGenerator creates a new proto generator.

func NewProtoGeneratorWithOptions added in v0.10.6

func NewProtoGeneratorWithOptions(protoPackage, indir, outdir string, options *options.Options) *protogen.Generator

NewProtoGeneratorWithOptions creates a new proto generator with options.

func Proto2Excel

func Proto2Excel(protoPackage, indir, outdir string)

Proto2Excel converts protoconf files to excel files (with tableau header). TODO: fully usable generation of excel templates.

func SetLang added in v0.10.6

func SetLang(lang string) error

SetLang sets the default language. E.g: en, zh.

Types

type VersionInfo added in v0.10.6

type VersionInfo struct {
	ProtoGenVer string // version of protogen module
	ConfGenVer  string // version of confgen module
}

VersionInfo holds versions of tableau'd main modules.

func GetVersionInfo added in v0.10.6

func GetVersionInfo() *VersionInfo

GetVersionInfo returns VersionInfo of tableau.

Directories

Path Synopsis
cmd
internal
camelcase
Package camelcase is a micro package to split the words of a camelcase type string into a slice of words.
Package camelcase is a micro package to split the words of a camelcase type string into a slice of words.
confgen/mexporter
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.
fs
log
Refer:
Refer:
proto
test

Jump to

Keyboard shortcuts

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