fieldtypes

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2018 License: GPL-3.0 Imports: 10 Imported by: 0

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