Documentation
¶
Index ¶
- Constants
- func E0005(err error) error
- func GenConf(protoPackage, indir, outdir string, setters ...options.Option) error
- func GenProto(protoPackage, indir, outdir string, setters ...options.Option) error
- func Generate(protoPackage, indir, outdir string, setters ...options.Option) error
- func NewConfGenerator(protoPackage, indir, outdir string, options ...options.Option) *confgen.Generator
- func NewConfGeneratorWithOptions(protoPackage, indir, outdir string, options *options.Options) *confgen.Generator
- func NewProtoGenerator(protoPackage, indir, outdir string, options ...options.Option) *protogen.Generator
- func NewProtoGeneratorWithOptions(protoPackage, indir, outdir string, options *options.Options) *protogen.Generator
- func SetLang(lang string) error
- func WrapKV(err error, keysAndValues ...any) error
- type CellLocation
- type Error
- type ErrorDetail
- type FieldLocation
- type SourceLocation
- type VersionInfo
Constants ¶
const ( KeyBookName = xerrors.KeyBookName // workbook name KeySheetName = xerrors.KeySheetName // worksheet name KeyBookAlias = xerrors.KeyBookAlias // schema workbook alias KeySheetAlias = xerrors.KeySheetAlias // schema worksheet alias KeyMerger = xerrors.KeyMerger // merger sheet specifiers ([]string) KeyScatter = xerrors.KeyScatter // scatter sheet specifiers ([]string) )
Source metadata keys for WrapKV and GetValue. Inspect maps these fields to ErrorDetail.Source.
Variables ¶
This section is empty.
Functions ¶
func E0005 ¶ added in v0.17.0
E0005 marks custom check failures with code E0005 (custom check failed). Joined errors retain one detail per failure and their original messages. Existing codes and metadata take precedence; causes and stacks are preserved. Nil returns nil. Use Inspect at the reporting boundary for text or JSON.
func GenConf ¶ added in v0.9.6
GenConf converts Excel/CSV/XML/YAML files to different configuration files: JSON, Text, and Bin.
func Generate ¶ added in v0.9.14
Generate converts Excel/CSV/XML/YAML files to protoconf files and different configuration files: JSON, Text, and Bin.
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 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 WrapKV ¶ added in v0.17.0
WrapKV adds metadata to err. It captures the caller's stack only when err has no stack trace. Existing metadata on each failure takes precedence over these values. Fields on an errors.Join result apply to its children; Tableau's collected errors retain their individual source scopes. Use Inspect for reporting. It preserves the cause chain and returns nil when err is nil. keysAndValues contains alternating keys and values; an odd length panics.
Types ¶
type CellLocation ¶ added in v0.17.0
type CellLocation = xerrors.CellLocation
CellLocation contains the source position and data of a cell. Position can also identify a node in a document input. TrimmedData is used for headers.
type Error ¶ added in v0.17.0
Error reports one or more structured failures from Tableau. Use Inspect to obtain it from an operation's error. Details contains one entry per failure, including when only one cell fails. Error renders these details as a localized summary. JSON omits underlying errors and stack traces.
func Inspect ¶ added in v0.17.0
Inspect collects all failures in err into an independent *Error snapshot. Wrapped and joined errors are flattened into Details, preserving each failure's metadata. The Error method renders the details consistently, numbering multiple failures in one sequence: [1], [2], [3], ... Call Inspect once at the reporting boundary.
Editing the snapshot does not change err. Original causes remain reachable through errors.Is and errors.As. An ordinary Go error yields one detail containing its message; nil returns nil.
type ErrorDetail ¶ added in v0.17.0
type ErrorDetail = xerrors.ErrorDetail
ErrorDetail describes one failure, independently of error wrappers and localized text formatting. Source and Field are omitted when unavailable.
type FieldLocation ¶ added in v0.17.0
type FieldLocation = xerrors.FieldLocation
FieldLocation identifies the protobuf message and field associated with a failure. Options contains the textual Tableau field options, when available.
type SourceLocation ¶ added in v0.17.0
type SourceLocation = xerrors.SourceLocation
SourceLocation identifies the actual source of a failure. PrimaryWorkbook and PrimaryWorksheet identify the schema's source when a shard is loaded. Aliases and merger/scatter specifiers describe that schema, independently of the actual workbook, worksheet, and cell where the failure occurred. WorksheetAlias is the protobuf message name when it differs from the schema worksheet name.
type VersionInfo ¶ added in v0.10.6
type VersionInfo struct {
Version string // version of tableau
ProtogenVersion string // version of protogen module
ConfgenVersion string // version of confgen module
// VCS info
Revision string
Time string
Experimental string
}
VersionInfo holds versions of tableau's main modules and VCS info.
func GetVersionInfo ¶ added in v0.10.6
func GetVersionInfo() *VersionInfo
GetVersionInfo returns VersionInfo of tableau.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
tableauc
command
|
|
|
internal
|
|
|
importer/xlsx
Package xlsx reads raw cell values from selected OOXML worksheets.
|
Package xlsx reads raw cell values from selected OOXML worksheets. |
|
profile
Package profile measures generator work and writes CPU and memory profiles.
|
Package profile measures generator work and writes CPU and memory profiles. |
|
strcase
Package strcase converts strings to various cases.
|
Package strcase converts strings to various cases. |
|
strcase/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. |
|
tools/cmd/ecode
command
|
|
|
x/xerrors
Package xerrors provides contextual error chains and structured error results.
|
Package xerrors provides contextual error chains and structured error results. |
|
Package load provides functions to load a protobuf message from different formats:
|
Package load provides functions to load a protobuf message from different formats: |
|
Refer:
|
Refer: |
|
proto
|
|
|
Package store provides functions to store a protobuf message to different formats: json, bin, and txt.
|
Package store provides functions to store a protobuf message to different formats: json, bin, and txt. |
|
test
|
|
|
functest
command
|