aicra/config/datatype/types.go

13 lines
433 B
Go
Raw Normal View History

package datatype
// Validator returns whether a given value fulfills a datatype
// and casts the value into a compatible type
type Validator func(value interface{}) (cast interface{}, valid bool)
2020-03-14 15:16:30 +00:00
// DataType builds a DataType from the type definition (from the
// configuration field "type") and returns NIL if the type
// definition does not match this DataType
2020-03-14 15:16:30 +00:00
type DataType interface {
Build(typeDefinition string) Validator
}