types

package
v0.0.0-...-914d145 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBooleanTest

func NewBooleanTest() tests.Test

NewBooleanTest returns a fresh BooleanTest

func NewFloatTest

func NewFloatTest() tests.Test

NewFloatTest returns a fresh FloatTest

func NewGroup

func NewGroup() tests.Group

NewGroup creates a new test group for the type tests

func NewSignedTest

func NewSignedTest() tests.Test

NewSignedTest returns a fresh SignedTest

func NewStringTest

func NewStringTest() tests.Test

NewStringTest returns a fresh StringTest

func NewSuite

func NewSuite(skipFirst bool) tests.Suite

NewSuite returns a fresh Suite

func NewTimeTest

func NewTimeTest() tests.Test

NewTimeTest returns a fresh TimeTest

func NewUnsignedTest

func NewUnsignedTest() tests.Test

NewUnsignedTest returns a fresh UnsignedTest

Types

type BooleanTest

type BooleanTest struct {
	// contains filtered or unexported fields
}

BooleanTest checks if a column contains only boolstamps and identifies their layout

func (*BooleanTest) Passed

func (t *BooleanTest) Passed() bool

Passed returns true if and only if all entries were bools

func (*BooleanTest) PrintResult

func (t *BooleanTest) PrintResult(out io.Writer)

PrintResult indicates either failure or the detected bool types

func (*BooleanTest) Run

func (t *BooleanTest) Run(cell string)

Run attempts to convert the current cell to many different bool types

type FloatTest

type FloatTest struct {
	// contains filtered or unexported fields
}

FloatTest checks if a column contains only floating point numbers and identifies their size

func (*FloatTest) Passed

func (f *FloatTest) Passed() bool

Passed returns true if and only if all entries were floats

func (*FloatTest) PrintResult

func (f *FloatTest) PrintResult(out io.Writer)

PrintResult indicates either failure or the smallest applicable float type

func (*FloatTest) Run

func (f *FloatTest) Run(cell string)

Run attempts to convert the current cell to a float64, then ckecks if it can be a float32

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group is a set of Type tests to run for a set of related values

func (*Group) PrintResult

func (g *Group) PrintResult(dst io.Writer)

PrintResult writes out the results of the type tests

func (*Group) Run

func (g *Group) Run(cell string)

Run hands the same string to all of the tests

type SignedTest

type SignedTest struct {
	// contains filtered or unexported fields
}

SignedTest checks if a column contains only signed integers and identifies their size

func (*SignedTest) Passed

func (s *SignedTest) Passed() bool

Passed returns true if and only if all entries were signed integers

func (*SignedTest) PrintResult

func (s *SignedTest) PrintResult(out io.Writer)

PrintResult indicates either failure or the smallest applicable signed type

func (*SignedTest) Run

func (s *SignedTest) Run(cell string)

Run attempts to convert the current cell to an integer, storing the max magnitude if found

type StringTest

type StringTest struct {
	// contains filtered or unexported fields
}

StringTest checks if a column contains only boolstamps and identifies their layout

func (*StringTest) Passed

func (s *StringTest) Passed() bool

Passed always returns true

func (*StringTest) PrintResult

func (s *StringTest) PrintResult(out io.Writer)

PrintResult indicates either failure or the detected string class

func (*StringTest) Run

func (s *StringTest) Run(cell string)

Run attempts to detect the character class of the current string

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

Suite checks for empty cells

func (*Suite) Run

func (t *Suite) Run(src *csv.Reader, dst io.Writer) (err error)

Run reads an entire CSV, noting empty cells as it goes

type TimeTest

type TimeTest struct {
	// contains filtered or unexported fields
}

TimeTest checks if a column contains only timestamps and identifies their layout

func (*TimeTest) Passed

func (t *TimeTest) Passed() bool

Passed returns true if and only if all entries were times

func (*TimeTest) PrintResult

func (t *TimeTest) PrintResult(out io.Writer)

PrintResult indicates either failure or the detected time types

func (*TimeTest) Run

func (t *TimeTest) Run(cell string)

Run attempts to convert the current cell to many different time types

type UnsignedTest

type UnsignedTest struct {
	// contains filtered or unexported fields
}

UnsignedTest checks if a column contains only unsigned integers and identifies their size

func (*UnsignedTest) Passed

func (u *UnsignedTest) Passed() bool

Passed returns true if and only if all entries were unsigned integers

func (*UnsignedTest) PrintResult

func (u *UnsignedTest) PrintResult(out io.Writer)

PrintResult indicates either failure or the smallest applicable unsigned type

func (*UnsignedTest) Run

func (u *UnsignedTest) Run(cell string)

Run attempts to convert the current cell to an integer, storing the maximum if found

Jump to

Keyboard shortcuts

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