fieldtypes

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2017 License: GPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertValues

func ConvertValues(d []string, typ EntityType) ([]interface{}, error)

func GetDate

func GetDate(t1 string) (time.Time, string, error)

func GetDateTime

func GetDateTime(t string) (time.Time, string, error)

func GetTime

func GetTime(t string) (time.Time, string, error)

func GetTimeByFormat

func GetTimeByFormat(t string, f string) (time.Time, error)

func IsFloat

func IsFloat(d string) (bool, interface{})

func IsInt

func IsInt(d string) (bool, interface{})

func IsNumber

func IsNumber(d string) (bool, interface{})

Types

type ByLength

type ByLength []string

func (ByLength) Len

func (s ByLength) Len() int

func (ByLength) Less

func (s ByLength) Less(i, j int) bool

func (ByLength) Swap

func (s ByLength) Swap(i, j int)

type DataTypeDetector

type DataTypeDetector struct {
	DataType         EntityType
	DetectorType     string
	DetectorFunction func(string) (bool, interface{})
	Attributes       map[string]interface{}
}

type EntityType

type EntityType int
const (
	DateTime EntityType = iota
	Id
	Time
	Date
	Ipaddress
	Money
	Rating5
	Rating10
	Rating100
	Timestamp
	NumberInt
	NumberFloat
	Boolean
	Latitude
	Longitude
	City
	Country
	Continent
	State
	Pincode
	Content
	Label
	Alias
	Color
	Json
	Email
	Namespace
	Name
	None
)

func DetectType

func DetectType(d []string) (entityType EntityType, hasHeaders bool, err error)

func (EntityType) MarshalJSON

func (t EntityType) MarshalJSON() ([]byte, error)

func (EntityType) String

func (t EntityType) String() string

Jump to

Keyboard shortcuts

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