schema

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 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
	Status      Status

	NErrs  int
	NNA    int
	NEMPTY int
	NVALID int
}

type SchemaRules

type SchemaRules struct {
	// Directives
	Separater    rune
	ExactColumns int
	// Checks
	CheckOrdered bool
	Ordered      bool
	CheckFixed   bool
	Fixed        bool
	ExtraCols    []string
	// 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

	// Output configuration
	OutputOrder string // by data input or by schema
}

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.

type Status added in v0.0.5

type Status int

Define the column status

func (Status) String added in v0.0.5

func (s Status) String() string

Jump to

Keyboard shortcuts

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