Documentation
¶
Overview ¶
Code generated by internal/tools/cmd/ecode. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func E0001(sheetName string, bookName string) error
- func E0002(filename string, messageName string, error_ error, lines string) error
- func E0003(name string, position1 string, position2 string) error
- func E2000(type_ string, value string, min any, max any) error
- func E2001(refer string, messageName string) error
- func E2002(value string, refer string) error
- func E2003(value string, sequence int64) error
- func E2004(value any, range_ string) error
- func E2005(key any) error
- func E2006(value any, enumName any) error
- func E2007(value any, error_ error) error
- func E2008(value any, error_ error) error
- func E2009(key any, fieldName string) error
- func E2010(typeValue any, fieldNumber any) error
- func E2011() error
- func E2012(fieldType any, value any, error_ error) error
- func E2013(value any, error_ error) error
- func E2014(column string) error
- func E2015(column string, bookName string, sheetName string) error
- func E2016(firstNonePresentIndex int, nextPresentIndex int) error
- func E2017(mapType string) error
- func E2018(keyName string) error
- func E2019(value string, error_ error) error
- func E2020(value string, error_ error) error
- func E2021(enumType any, enumValue1 any, enumValue2 any, alias any) error
- func E2022(fieldName string, key any) error
- func E2023(currValue any, prevValue any) error
- func E2024(value string, error_ error) error
- func E2025(value string, pattern string) error
- func E2026(value any, prevValue any, order string) error
- func E2027(violation string, fieldValue any) error
- func E2028(elem any) error
- func E3000(sheetSpecifier string, pattern string) error
- func E3001(sheetName string, bookName string) error
- func E3002(error_ error) error
- func E3003(glob string) error
- func New(msg string) error
- func NewKV(msg string, keysAndValues ...any) error
- func Newf(format string, args ...any) error
- func Wrap(err error) error
- func WrapKV(err error, keysAndValues ...any) error
- func Wrapf(err error, format string, args ...any) error
- type Collector
- type Desc
- type Frame
- type Group
- type StackTrace
Constants ¶
const ( ModuleDefault = "default" ModuleProto = "protogen" ModuleConf = "confgen" )
const ( // Drives Desc.Stringify rendering; values: default, proto, conf. KeyModule = "Module" KeyIndir = "Indir" // input dir KeySubdir = "Subdir" // input subdir KeyOutdir = "Outdir" // output dir KeyBookName = "BookName" // workbook name KeyPrimaryBookName = "PrimaryBookName" // primary workbook name KeySheetName = "SheetName" // worksheet name KeyPrimarySheetName = "PrimarySheetName" // primary worksheet name KeyNameCellPos = "NameCellPos" // name cell position KeyNameCell = "NameCell" // name cell value KeyTrimmedNameCell = "TrimmedNameCell" // trimmed name cell value KeyTypeCellPos = "TypeCellPos" // type cell position KeyTypeCell = "TypeCell" // type cell value KeyNoteCellPos = "NoteCellPos" // note cell position KeyNoteCell = "NoteCell" // note cell value KeyDataCellPos = "DataCellPos" // data cell position KeyDataCell = "DataCell" // data data value KeyPBMessage = "PBMessage" // protobuf message name KeyPBFieldName = "PBFieldName" // protobuf message field name KeyPBFieldType = "PBFieldType" // protobuf message field type KeyPBFieldOpts = "PBFieldOpts" // protobuf message field options (extensions) KeyColumnName = "ColumnName" // column name KeyReason = "Reason" // error reason )
desc keys
Variables ¶
var ErrE0001 = newEcode("E0001", `sheet not found in book`)
var ErrE0002 = newEcode("E0002", `cannot unmarshal file content to given proto.Message`)
var ErrE0003 = newEcode("E0003", `duplicate column name`)
var ErrE2000 = newEcode("E2000", `integer overflow`)
var ErrE2001 = newEcode("E2001", `field prop "refer" not configured correctly`)
var ErrE2002 = newEcode("E2002", `field value not in referred space`)
var ErrE2003 = newEcode("E2003", `illegal sequence number`)
var ErrE2004 = newEcode("E2004", `value is out of range`)
var ErrE2005 = newEcode("E2005", `map key not unique`)
var ErrE2006 = newEcode("E2006", `enum value not defined in enum type`)
var ErrE2007 = newEcode("E2007", `invalid datetime format`)
var ErrE2008 = newEcode("E2008", `invalid duration format`)
var ErrE2009 = newEcode("E2009", `duplicate key exists in different sheets`)
var ErrE2010 = newEcode("E2010", `union type has no corresponding value field`)
var ErrE2011 = newEcode("E2011", `field presence required but cell not filled`)
var ErrE2012 = newEcode("E2012", `invalid syntax of numerical value`)
var ErrE2013 = newEcode("E2013", `invalid syntax of boolean value`)
var ErrE2014 = newEcode("E2014", `sheet column not found`)
var ErrE2015 = newEcode("E2015", `referred sheet column not found`)
var ErrE2016 = newEcode("E2016", `list elements are not present continuously`)
var ErrE2017 = newEcode("E2017", `map contains multiple empty keys`)
var ErrE2018 = newEcode("E2018", `map key not exists`)
var ErrE2019 = newEcode("E2019", `invalid fraction pattern`)
var ErrE2020 = newEcode("E2020", `invalid comparator pattern`)
var ErrE2021 = newEcode("E2021", `duplicate enum value alias`)
var ErrE2022 = newEcode("E2022", `sub-field's value not unique in map values or list elements`)
var ErrE2023 = newEcode("E2023", `field value conflict across rows or columns`)
var ErrE2024 = newEcode("E2024", `invalid version pattern`)
var ErrE2025 = newEcode("E2025", `version value mismatches pattern`)
var ErrE2026 = newEcode("E2026", `illegally ordered values`)
var ErrE2027 = newEcode("E2027", `protovalidate violation`)
var ErrE2028 = newEcode("E2028", `duplicate elements in incell keyed-list`)
var ErrE3000 = newEcode("E3000", `no workbook file found about sheet specifier`)
var ErrE3001 = newEcode("E3001", `no worksheet found in workbook`)
var ErrE3002 = newEcode("E3002", `failed to open file`)
var ErrE3003 = newEcode("E3003", `CSV workbook glob pattern matches no files`)
Functions ¶
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector accumulates errors concurrently up to a configurable limit. Collectors form a hierarchy via Collector.NewChild; Collector.Join recursively merges own errors with children's.
When a child's [collected] error is wrapped (e.g. via WrapKV), the outer [withMessage] is remembered and re-applied in Collector.Join, producing: collected → withMessage{fields} → joinError{…}.
func NewCollector ¶
NewCollector creates a root Collector. maxErrs: <=0 unlimited, 1 fail-fast, >1 stops after N errors.
func (*Collector) Collect ¶
Collect accumulates err into the collector.
- nil err: no-op unless this collector (or an ancestor) is already full, in which case the joined error tree is returned immediately.
- already-collected err (*collected): records the outer WrapKV layer for re-wrapping in Join; does not increment any counter.
- ordinary err: increments every ancestor's counter, stores the error if it is within every ancestor's budget, and returns the joined error tree if any ancestor has now reached its limit (nil otherwise).
func (*Collector) HasErrors ¶
HasErrors reports whether this collector's subtree has any errors. It is a fast, lock-free check suitable for guarding expensive Collector.Join calls.
func (*Collector) IsFull ¶
IsFull reports whether this collector or any ancestor has reached its limit.
func (*Collector) NewChild ¶
NewChild creates a child collector registered under the receiver. maxErrs semantics are the same as NewCollector.
type Desc ¶
type Desc struct {
// contains filtered or unexported fields
}
Desc holds structured fields extracted from an error chain. For joined multi-errors, children holds one *Desc per child.
func NewDesc ¶
NewDesc builds a *Desc from err. Single-chain wrappers are traversed to find inner multi-errors; all nested joins are fully flattened with outer fields (e.g. Module, BookName) merged in (innermost wins). Returns nil for nil err.
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame. For historical reasons if Frame is interpreted as a uintptr its value represents the program counter + 1.
func (Frame) Format ¶
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s function name and path of source file relative to the compile time
GOPATH separated by \n\t (<funcname>\n\t<path>)
%+v equivalent to %+s:%d
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group ties an errgroup.Group to a Collector for concurrent collection. Context is cancelled when the collector becomes full.
type StackTrace ¶
type StackTrace []Frame
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
func (StackTrace) Format ¶
func (st StackTrace) Format(s fmt.State, verb rune)
Format formats the stack of Frames according to the fmt.Formatter interface.
%s lists source files for each Frame in the stack %v lists the source file and line number for each Frame in the stack
Format accepts flags that alter the printing of some verbs, as follows:
%+v Prints filename, function, and line number for each Frame in the stack.