Documentation
¶
Index ¶
- func CheckInRange(prop *tableaupb.FieldProp, fieldKind protoreflect.Kind, ...) error
- func CheckOrder(fd protoreflect.FieldDescriptor, oldVal, newVal protoreflect.Value, ...) (any, any, bool)
- func CheckPresence(prop *tableaupb.FieldProp, present bool) error
- func GetSize(prop *tableaupb.FieldProp, detectedSize int) int
- func HasUnique(prop *tableaupb.FieldProp) bool
- func InReferredSpace(ctx context.Context, prop *tableaupb.FieldProp, cellData string, input *Input) (bool, error)
- func IsFixed(prop *tableaupb.FieldProp) bool
- func RequireOrder(prop *tableaupb.FieldProp) bool
- func RequireSequence(prop *tableaupb.FieldProp) bool
- func RequireUnique(prop *tableaupb.FieldProp) bool
- type Input
- type ReferDesc
- type ReferredCache
- type ValueSpace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckInRange ¶
func CheckInRange(prop *tableaupb.FieldProp, fieldKind protoreflect.Kind, value protoreflect.Value, present bool) error
CheckInRange checks whether the value is in the range.
func CheckOrder ¶ added in v0.15.0
func CheckOrder(fd protoreflect.FieldDescriptor, oldVal, newVal protoreflect.Value, order tableaupb.Order) (any, any, bool)
CheckOrder checks whether the given field values are ordered. If not ordered, it will return the parsed old and new values for debugging.
func GetSize ¶
GetSize returns the specified size of horizontal list/map. detectedSize is the scanned size of name row.
func InReferredSpace ¶
func InReferredSpace(ctx context.Context, prop *tableaupb.FieldProp, cellData string, input *Input) (bool, error)
InReferredSpace checks whether the cell data is at least in one of the other sheets' column value space (aka message's field value space). prop.Refer is comma separated, e.g.: "SheetName(SheetAlias).ColumnName[,SheetName(SheetAlias).ColumnName]..."
func RequireOrder ¶ added in v0.15.0
RequireOrder checks whether the field's order property is set explicitly.
func RequireSequence ¶ added in v0.14.0
RequireSequence checks whether the field's sequence property is set explicitly.
func RequireUnique ¶
RequireUnique checks whether the field's unique property is set explicitly.
Types ¶
type ReferDesc ¶
type ReferDesc struct {
Sheet string // sheet name in workbook.
Alias string // sheet alias: if set, used as protobuf message name.
Column string // sheet column name in name row.
}
func (*ReferDesc) GetMessageName ¶
type ReferredCache ¶
func NewReferredCache ¶
func NewReferredCache() *ReferredCache
func (*ReferredCache) Exists ¶
func (r *ReferredCache) Exists(refer string) bool
func (*ReferredCache) ExistsValue ¶
func (r *ReferredCache) ExistsValue(refer string, value string, loadFunc loadValueSpaceFunc) (bool, error)
func (*ReferredCache) Put ¶
func (r *ReferredCache) Put(refer string, valueSpace *ValueSpace)
type ValueSpace ¶
func NewValueSpace ¶
func NewValueSpace() *ValueSpace
func (*ValueSpace) AddFromTable ¶ added in v0.15.0
func (v *ValueSpace) AddFromTable(header *tableparser.Header, table book.Tabler, columnName, bookName, sheetName string) error