schema

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Col

type Col struct {
	Name        string
	Rule        string
	Description string
}

type SchemaRules

type SchemaRules struct {
	// Directives
	Separater    rune
	ExactColumns int
	// Checks
	CheckOrdered bool
	Ordered      bool
	CheckFixed   bool
	Fixed        bool
	// Other
	Comment  rune
	Errors   int      // count of schema-specific errors
	NA       []string // NA values
	EMPTY    []string // empty values
	YAMLData map[string]interface{}

	// Columns
	Columns []Col
}

func ParseSchema

func ParseSchema(schemaFile string) SchemaRules

Parse Schema - Entrypoint

func (*SchemaRules) IsFixed

func (s *SchemaRules) IsFixed(colnames []string)

IsFixed - test whether column names match exactly

func (*SchemaRules) IsOrdered

func (s *SchemaRules) IsOrdered(colnames []string)

IsOrdered - test whether column names are in the same order as the schema.

Jump to

Keyboard shortcuts

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