fieldprop

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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 CheckPresence

func CheckPresence(prop *tableaupb.FieldProp, present bool) error

func GetSize

func GetSize(prop *tableaupb.FieldProp, detectedSize int) int

GetSize returns the specified size of horizontal list/map. detectedSize is the scanned size of name row.

func HasUnique

func HasUnique(prop *tableaupb.FieldProp) bool

HasUnique checks whether the unique field is set explicitly.

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 IsFixed

func IsFixed(prop *tableaupb.FieldProp) bool

IsFixed check the horizontal list/map is fixed size or not.

func RequireOrder added in v0.15.0

func RequireOrder(prop *tableaupb.FieldProp) bool

RequireOrder checks whether the field's order property is set explicitly.

func RequireSequence added in v0.14.0

func RequireSequence(prop *tableaupb.FieldProp) bool

RequireSequence checks whether the field's sequence property is set explicitly.

func RequireUnique

func RequireUnique(prop *tableaupb.FieldProp) bool

RequireUnique checks whether the field's unique property is set explicitly.

Types

type Input

type Input struct {
	ProtoPackage   string
	InputDir       string
	SubdirRewrites map[string]string
	PRFiles        *protoregistry.Files
	Present        bool // field presence
}

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

func (r *ReferDesc) GetMessageName() string

type ReferredCache

type ReferredCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

type ValueSpace struct {
	*hashset.Set
}

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

Jump to

Keyboard shortcuts

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