parser

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LineParser added in v1.1.0

func LineParser(line string) (LineParserState, ParserData, error)

func ParseRelationProp

func ParseRelationProp(relation string) (string, string)

func ParseVectorProp

func ParseVectorProp(value string) (types.FieldType, int)

Types

type Field

type Field struct {
	Name             string
	BuiltinType      types.FieldType
	Properties       map[types.FieldProp]string
	IncrementTracker int
}

func (*Field) AutoIncrement added in v1.1.6

func (field *Field) AutoIncrement() int

func (*Field) IndexLevel added in v1.1.6

func (field *Field) IndexLevel() IndexLevel

type IndexLevel added in v1.1.6

type IndexLevel int
const (
	IndexLevelNone IndexLevel = iota
	IndexLevelUnique
	IndexLevelPrimary
)

type IntCompare added in v1.1.4

type IntCompare string
const (
	IntCompareEqual          IntCompare = "eq"
	IntCompareNotEqual       IntCompare = "ne"
	IntCompareGreater        IntCompare = "gt"
	IntCompareLess           IntCompare = "lt"
	IntCompareGreaterOrEqual IntCompare = "gte"
	IntCompareLessOrEqual    IntCompare = "lte"
)

type LineParserState added in v1.1.0

type LineParserState int
const (
	ParserStateTableStart LineParserState = iota
	ParserStateTableEnd
	ParserStateNewField
	ParserStateIdle
)

type ParserData added in v1.1.0

type ParserData struct {
	Name         string
	Builtin_type types.FieldType
	Properties   map[types.FieldProp]string
}

type StringCompare added in v1.1.4

type StringCompare string
const (
	StringCompareContains   StringCompare = "contains"
	StringCompareStartsWith StringCompare = "startsWith"
	StringCompareEndsWith   StringCompare = "endsWith"
)

type Table

type Table struct {
	Name      string
	Fields    map[string]Field
	Indexes   []string
	IdTracker int
}

func (*Table) Compare added in v1.1.4

func (table *Table) Compare(field *Field, value any, input any) bool

func (*Table) CreateId added in v1.1.5

func (table *Table) CreateId() int

func (*Table) ValidateType added in v1.1.4

func (table *Table) ValidateType(field *Field, input any, allow_default bool) (any, error)

Jump to

Keyboard shortcuts

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