Documentation ¶
Overview ¶
The Model of MVC.
Index ¶
- Constants
- Variables
- func CopyFields(dst, src interface{}) (err error)
- func CopyFieldsIfNotEmpty(dst, src interface{}) (err error)
- func GenerateRandomPassword(length int) (string, error)
- func Iterate(i Iterator, callback interface{}) error
- func IterateToChannel(i Iterator) (docs <-chan interface{}, errs <-chan error)
- func NormalizePhoneNumber(number string) string
- func ParseTagAttribs(tag string) map[string]string
- func PasswordHash(password string) string
- func Visit(model interface{}, visitor Visitor) error
- func VisitMaxDepth(model interface{}, maxDepth int, visitor Visitor) error
- type Blob
- type Bool
- type Choice
- func (self *Choice) Get() string
- func (self *Choice) IsEmpty() bool
- func (self *Choice) Options(metaData *MetaData) []string
- func (self *Choice) Required(metaData *MetaData) bool
- func (self *Choice) Set(value string)
- func (self *Choice) SetString(str string) error
- func (self *Choice) String() string
- func (self *Choice) Validate(metaData *MetaData) error
- type Color
- func (self *Color) EqualsColor(c color.Color) bool
- func (self *Color) GetOrDefault(defaultColor string) string
- func (self *Color) IsEmpty() bool
- func (self *Color) IsValid() bool
- func (self *Color) RGBA() color.RGBA
- func (self *Color) Required(metaData *MetaData) bool
- func (self *Color) SetString(s string)
- func (self *Color) String() string
- func (self *Color) Validate(metaData *MetaData) error
- type Configuration
- type Country
- func (self *Country) EnglishName() string
- func (self *Country) FixValue(metaData *MetaData)
- func (self *Country) Get() string
- func (self *Country) IsEmpty() bool
- func (self *Country) Required(metaData *MetaData) bool
- func (self *Country) Set(value string) error
- func (self *Country) SetString(str string) error
- func (self *Country) String() string
- func (self *Country) Validate(metaData *MetaData) error
- type Date
- func (self *Date) FixValue(metaData *MetaData)
- func (self *Date) Format(format string) string
- func (self *Date) Get() string
- func (self *Date) IsEmpty() bool
- func (self *Date) Required(metaData *MetaData) bool
- func (self *Date) Set(value string) error
- func (self *Date) SetEmpty()
- func (self *Date) SetString(str string) error
- func (self *Date) SetTime(t time.Time)
- func (self *Date) SetTodayUTC()
- func (self *Date) SetUnixNanoseconds(nanos int64)
- func (self *Date) String() string
- func (self *Date) Time() time.Time
- func (self *Date) UnixNanoseconds() int64
- func (self *Date) Validate(metaData *MetaData) error
- type DateTime
- func (self *DateTime) FixValue(metaData *MetaData)
- func (self *DateTime) Format(format string) string
- func (self *DateTime) Get() string
- func (self *DateTime) IsEmpty() bool
- func (self *DateTime) Required(metaData *MetaData) bool
- func (self *DateTime) Set(value string) (err error)
- func (self *DateTime) SetEmpty()
- func (self *DateTime) SetNowUTC()
- func (self *DateTime) SetString(str string) error
- func (self *DateTime) SetTime(t time.Time)
- func (self *DateTime) SetUnixNanoseconds(nanos int64)
- func (self *DateTime) String() string
- func (self *DateTime) Time() time.Time
- func (self *DateTime) UnixNanoseconds() int64
- func (self *DateTime) Validate(metaData *MetaData) error
- type DynamicChoice
- func (self *DynamicChoice) CheckIndex(index int) error
- func (self *DynamicChoice) GetBSON() (interface{}, error)
- func (self *DynamicChoice) Index() int
- func (self *DynamicChoice) IsEmpty() bool
- func (self *DynamicChoice) Options() []string
- func (self *DynamicChoice) Required(metaData *MetaData) bool
- func (self *DynamicChoice) SetBSON(raw bson.Raw) (err error)
- func (self *DynamicChoice) SetIndex(index int) error
- func (self *DynamicChoice) SetOptions(options []string)
- func (self *DynamicChoice) SetString(str string) error
- func (self *DynamicChoice) String() string
- func (self *DynamicChoice) Validate(metaData *MetaData) error
- type DynamicValue
- type DynamicValues
- type Email
- func (self *Email) EqualsCaseinsensitive(address string) bool
- func (self *Email) FixValue(metaData *MetaData)
- func (self *Email) Get() string
- func (self *Email) IsEmpty() bool
- func (self *Email) Required(metaData *MetaData) bool
- func (self *Email) Set(value string) (err error)
- func (self *Email) SetString(str string) (err error)
- func (self *Email) String() string
- func (self *Email) Validate(metaData *MetaData) error
- type EmptyIterator
- type ErrorOnlyIterator
- type FieldOnlyVisitor
- func (self FieldOnlyVisitor) BeginIndexedFields(*MetaData) error
- func (self FieldOnlyVisitor) BeginNamedFields(*MetaData) error
- func (self FieldOnlyVisitor) EndIndexedFields(*MetaData) error
- func (self FieldOnlyVisitor) EndNamedFields(*MetaData) error
- func (self FieldOnlyVisitor) IndexedField(field *MetaData) error
- func (self FieldOnlyVisitor) NamedField(field *MetaData) error
- type File
- type FilterFunc
- type FilterIterator
- type Float
- func (self *Float) Get() float64
- func (self *Float) IsEmpty() bool
- func (self *Float) IsValid() bool
- func (self *Float) Max(metaData *MetaData) (max float64, ok bool, err error)
- func (self *Float) Min(metaData *MetaData) (min float64, ok bool, err error)
- func (self *Float) Required(metaData *MetaData) bool
- func (self *Float) Set(value float64)
- func (self *Float) SetString(str string) error
- func (self *Float) String() string
- func (self *Float) Valid(metaData *MetaData) bool
- func (self *Float) Validate(metaData *MetaData) error
- type FloatAboveMax
- type FloatBelowMin
- type FloatNotReal
- type GeoLocation
- type IndexedObjectIterator
- type Int
- func (self *Int) Get() int64
- func (self *Int) GetInt() int
- func (self *Int) IsEmpty() bool
- func (self *Int) Max(metaData *MetaData) (max int64, ok bool, err error)
- func (self *Int) Min(metaData *MetaData) (min int64, ok bool, err error)
- func (self *Int) Required(metaData *MetaData) bool
- func (self *Int) Set(value int64)
- func (self *Int) SetInt(value int)
- func (self *Int) SetString(str string) error
- func (self *Int) String() string
- func (self *Int) Validate(metaData *MetaData) error
- type IntAboveMax
- type IntBelowMin
- type InvalidChoice
- type InvalidCountryCode
- type InvalidLanguageCode
- type Iterator
- func ConvertIterator(from Iterator, convertFunc func(interface{}) interface{}) Iterator
- func NewErrorOnlyIterator(err error) Iterator
- func NewIndexedObjectIterator(objects []interface{}, indices []int) Iterator
- func NewObjectIterator(objects ...interface{}) Iterator
- func NewObjectOrErrorOnlyIterator(object interface{}, err error) Iterator
- func RandomIterator(i Iterator) Iterator
- func SortIterator(i Iterator, lessFunc func(a, b interface{}) (less bool)) Iterator
- type IteratorFunc
- type Language
- func (self *Language) EnglishName() string
- func (self *Language) FixValue(metaData *MetaData)
- func (self *Language) Get() string
- func (self *Language) IsEmpty() bool
- func (self *Language) Required(metaData *MetaData) bool
- func (self *Language) Set(value string) error
- func (self *Language) SetString(str string) error
- func (self *Language) String() string
- func (self *Language) Validate(metaData *MetaData) error
- type LimitedIterator
- type MetaData
- func (self *MetaData) Attrib(tagKey, name string) (value string, ok bool)
- func (self *MetaData) BoolAttrib(tagKey, name string) bool
- func (self *MetaData) IsIndexedValue() bool
- func (self *MetaData) IsModelValue() bool
- func (self *MetaData) IsModelValueOrChild() bool
- func (self *MetaData) IsNamed() bool
- func (self *MetaData) IsNamedValue() bool
- func (self *MetaData) ModelValidator() (val Validator, ok bool)
- func (self *MetaData) ModelValue() (val Value, ok bool)
- func (self *MetaData) NameOrIndex() string
- func (self *MetaData) NameOrWildcard() string
- func (self *MetaData) Path() []*MetaData
- func (self *MetaData) RootParent() *MetaData
- func (self *MetaData) Selector() string
- func (self *MetaData) SelectorsMatch(list []string) bool
- func (self *MetaData) String() string
- func (self *MetaData) WildcardSelector() string
- type MetaDataKind
- type MultipleChoice
- func (self *MultipleChoice) Get() []string
- func (self *MultipleChoice) IsEmpty() bool
- func (self *MultipleChoice) IsSet(option string) bool
- func (self *MultipleChoice) Options(metaData *MetaData) []string
- func (self *MultipleChoice) Required(metaData *MetaData) bool
- func (self *MultipleChoice) Set(value ...string)
- func (self *MultipleChoice) SetString(str string) error
- func (self *MultipleChoice) String() string
- func (self *MultipleChoice) Validate(metaData *MetaData) error
- type ObjectIterator
- type Password
- func (self *Password) EqualsHashed(value string) bool
- func (self *Password) FixValue(metaData *MetaData)
- func (self *Password) Get() string
- func (self *Password) IsEmpty() bool
- func (self *Password) Maxlen(metaData *MetaData) (maxlen int, ok bool, err error)
- func (self *Password) Minlen(metaData *MetaData) (minlen int, ok bool, err error)
- func (self *Password) Required(metaData *MetaData) bool
- func (self *Password) Set(value string)
- func (self *Password) SetHashed(value string)
- func (self *Password) SetString(str string) error
- func (self *Password) String() string
- func (self *Password) Validate(metaData *MetaData) error
- type Phone
- func (self *Phone) FixValue(metaData *MetaData)
- func (self *Phone) Get() string
- func (self *Phone) IsEmpty() bool
- func (self *Phone) Required(metaData *MetaData) bool
- func (self *Phone) Set(value string)
- func (self *Phone) SetString(str string) error
- func (self *Phone) String() string
- func (self *Phone) Validate(metaData *MetaData) error
- type Reference
- type RequiredError
- type String
- func (self *String) FixValue(metaData *MetaData)
- func (self *String) Get() string
- func (self *String) GetOrDefault(defaultString string) string
- func (self *String) IsEmpty() bool
- func (self *String) Maxlen(metaData *MetaData) (maxlen int, ok bool, err error)
- func (self *String) Minlen(metaData *MetaData) (minlen int, ok bool, err error)
- func (self *String) Required(metaData *MetaData) bool
- func (self *String) Set(value string)
- func (self *String) SetString(str string) error
- func (self *String) String() string
- func (self *String) Validate(metaData *MetaData) error
- type StringTooLong
- type StringTooShort
- type Text
- func (self *Text) FixValue(metaData *MetaData)
- func (self *Text) Get() string
- func (self *Text) GetOrDefault(defaultText string) string
- func (self *Text) IsEmpty() bool
- func (self *Text) Maxlen(metaData *MetaData) (maxlen int, ok bool, err error)
- func (self *Text) Minlen(metaData *MetaData) (minlen int, ok bool, err error)
- func (self *Text) Required(metaData *MetaData) bool
- func (self *Text) Set(value string)
- func (self *Text) SetString(str string) error
- func (self *Text) String() string
- func (self *Text) Validate(metaData *MetaData) error
- type Time
- type Url
- func (self *Url) FixValue(metaData *MetaData)
- func (self *Url) Get() string
- func (self *Url) GetOrDefault(defaultURL string) string
- func (self *Url) IsEmpty() bool
- func (self *Url) Required(metaData *MetaData) bool
- func (self *Url) Set(value string) error
- func (self *Url) SetString(str string) error
- func (self *Url) String() string
- func (self *Url) Validate(metaData *MetaData) error
- type Validator
- type Value
- type Visitor
- type VisitorFunc
- func (self VisitorFunc) BeginIndexedFields(indexedFields *MetaData) error
- func (self VisitorFunc) BeginNamedFields(namedFields *MetaData) error
- func (self VisitorFunc) EndIndexedFields(indexedFields *MetaData) error
- func (self VisitorFunc) EndNamedFields(namedFields *MetaData) error
- func (self VisitorFunc) IndexedField(field *MetaData) error
- func (self VisitorFunc) NamedField(field *MetaData) error
Constants ¶
const DateFormat = "2006-01-02"
const DateTimeFormat = "2006-01-02 15:04:05"
const ShortDateTimeFormat = "2006-01-02 15:04"
Variables ¶
var DynamicValueType = reflect.TypeOf(DynamicValue{})
var StructTagKey = "model"
Functions ¶
func CopyFields ¶
func CopyFields(dst, src interface{}) (err error)
CopyFields copies matching struct/array/slice fields that implement the Value interface from src to dst. Matching is done by comparing the MetaData.Selector() of the fields. Copying is done by calling SetString() of dst with the result from String() of src. This way even not exactly matching models can be copied by converting to and from strings if this is possible without errors.
func CopyFieldsIfNotEmpty ¶
func CopyFieldsIfNotEmpty(dst, src interface{}) (err error)
CopyFieldsIfNotEmpty copies matching struct/array/slice fields that implement the Value interface from src to dst, if IsEmpty() of src returns false. Matching is done by comparing the MetaData.Selector() of the fields. Copying is done by calling SetString() of dst with the result from String() of src. This way even not exactly matching models can be copied by converting to and from strings if this is possible without errors.
func GenerateRandomPassword ¶
func IterateToChannel ¶
Channels will be closed after last result
func NormalizePhoneNumber ¶
func ParseTagAttribs ¶
func PasswordHash ¶
func VisitMaxDepth ¶
Types ¶
type Blob ¶
type Blob []byte
Blob is just a bunch of bytes. Struct tag attributes:
`model:"required"`
type Choice ¶
type Choice string
Choice can hold one of several string options. The options are defined by the struct tag attribute "options" delimited by colons ",". A colon in an option can be escaped with "\," An empty string can be used as the first option. Choice is required, when the first option in not an empty string. Struct tag attributes:
`model:"options=Red,Green,Blue"` `model:"options=,Second,Third"` // empty string is a valid value
type Color ¶
type Color string
Color holds a hex web-color with the # prefix. The Set method accepts all valid web color syntaxes except for color names. Struct tag attributes:
`model:"required"`
func (*Color) GetOrDefault ¶
type Configuration ¶
type Configuration struct {
Debug bool
}
var Config Configuration
func (*Configuration) Close ¶
func (self *Configuration) Close() error
func (*Configuration) Init ¶
func (self *Configuration) Init() error
func (*Configuration) Name ¶
func (self *Configuration) Name() string
type Date ¶
type Date string
func (*Date) SetTodayUTC ¶
func (self *Date) SetTodayUTC()
func (*Date) SetUnixNanoseconds ¶
func (*Date) UnixNanoseconds ¶
type DateTime ¶
type DateTime string
DateTime
func NewDateTime ¶
func (*DateTime) SetUnixNanoseconds ¶
func (*DateTime) UnixNanoseconds ¶
type DynamicChoice ¶
type DynamicChoice struct {
// contains filtered or unexported fields
}
func (*DynamicChoice) CheckIndex ¶
func (self *DynamicChoice) CheckIndex(index int) error
func (*DynamicChoice) GetBSON ¶
func (self *DynamicChoice) GetBSON() (interface{}, error)
func (*DynamicChoice) Index ¶
func (self *DynamicChoice) Index() int
func (*DynamicChoice) IsEmpty ¶
func (self *DynamicChoice) IsEmpty() bool
func (*DynamicChoice) Options ¶
func (self *DynamicChoice) Options() []string
func (*DynamicChoice) Required ¶
func (self *DynamicChoice) Required(metaData *MetaData) bool
func (*DynamicChoice) SetIndex ¶
func (self *DynamicChoice) SetIndex(index int) error
func (*DynamicChoice) SetOptions ¶
func (self *DynamicChoice) SetOptions(options []string)
func (*DynamicChoice) SetString ¶
func (self *DynamicChoice) SetString(str string) error
func (*DynamicChoice) String ¶
func (self *DynamicChoice) String() string
func (*DynamicChoice) Validate ¶
func (self *DynamicChoice) Validate(metaData *MetaData) error
type DynamicValue ¶
DynamicValue can be used to build a model dynamically instead of using a static typed struct. See DynamicValues
func (*DynamicValue) Attrib ¶
func (self *DynamicValue) Attrib(tagKey, name string) string
func (*DynamicValue) GetBSON ¶
func (self *DynamicValue) GetBSON() (interface{}, error)
func (*DynamicValue) SetAttrib ¶
func (self *DynamicValue) SetAttrib(tagKey, name, value string)
type DynamicValues ¶
type DynamicValues []DynamicValue
DynamicValues is used to create a model dynamically instead of using a static typed struct.
func (DynamicValues) Get ¶
func (self DynamicValues) Get(name string) (value *DynamicValue, found bool)
type EmptyIterator ¶
type EmptyIterator struct { }
func (*EmptyIterator) Err ¶
func (self *EmptyIterator) Err() error
func (*EmptyIterator) Next ¶
func (self *EmptyIterator) Next() interface{}
type ErrorOnlyIterator ¶
type ErrorOnlyIterator struct {
// contains filtered or unexported fields
}
func (*ErrorOnlyIterator) Err ¶
func (self *ErrorOnlyIterator) Err() error
func (*ErrorOnlyIterator) Next ¶
func (self *ErrorOnlyIterator) Next() interface{}
type FieldOnlyVisitor ¶
FieldOnlyVisitor calls its function for every struct, array and slice field.
func (FieldOnlyVisitor) BeginIndexedFields ¶
func (self FieldOnlyVisitor) BeginIndexedFields(*MetaData) error
func (FieldOnlyVisitor) BeginNamedFields ¶
func (self FieldOnlyVisitor) BeginNamedFields(*MetaData) error
func (FieldOnlyVisitor) EndIndexedFields ¶
func (self FieldOnlyVisitor) EndIndexedFields(*MetaData) error
func (FieldOnlyVisitor) EndNamedFields ¶
func (self FieldOnlyVisitor) EndNamedFields(*MetaData) error
func (FieldOnlyVisitor) IndexedField ¶
func (self FieldOnlyVisitor) IndexedField(field *MetaData) error
func (FieldOnlyVisitor) NamedField ¶
func (self FieldOnlyVisitor) NamedField(field *MetaData) error
type FilterFunc ¶
type FilterFunc func(doc interface{}) (ok bool)
type FilterIterator ¶
type FilterIterator struct { Iterator PassFilter FilterFunc }
func (*FilterIterator) Next ¶
func (self *FilterIterator) Next() interface{}
type FloatAboveMax ¶
func (*FloatAboveMax) Error ¶
func (self *FloatAboveMax) Error() string
type FloatBelowMin ¶
func (*FloatBelowMin) Error ¶
func (self *FloatBelowMin) Error() string
type FloatNotReal ¶
type FloatNotReal struct {
Value float64
}
func (*FloatNotReal) Error ¶
func (self *FloatNotReal) Error() string
type GeoLocation ¶
func (*GeoLocation) IsEmpty ¶
func (self *GeoLocation) IsEmpty() bool
func (*GeoLocation) Required ¶
func (self *GeoLocation) Required(metaData *MetaData) bool
func (*GeoLocation) SetString ¶
func (self *GeoLocation) SetString(str string) error
func (*GeoLocation) String ¶
func (self *GeoLocation) String() string
func (*GeoLocation) Validate ¶
func (self *GeoLocation) Validate(metaData *MetaData) error
type IndexedObjectIterator ¶
type IndexedObjectIterator struct {
// contains filtered or unexported fields
}
func (*IndexedObjectIterator) Err ¶
func (self *IndexedObjectIterator) Err() error
func (*IndexedObjectIterator) Next ¶
func (self *IndexedObjectIterator) Next() interface{}
type IntAboveMax ¶
func (*IntAboveMax) Error ¶
func (self *IntAboveMax) Error() string
type IntBelowMin ¶
func (*IntBelowMin) Error ¶
func (self *IntBelowMin) Error() string
type InvalidChoice ¶
func (*InvalidChoice) Error ¶
func (self *InvalidChoice) Error() string
type InvalidCountryCode ¶
type InvalidCountryCode struct {
CountryCode string
}
func (*InvalidCountryCode) String ¶
func (self *InvalidCountryCode) String() string
type InvalidLanguageCode ¶
type InvalidLanguageCode struct {
Language string
}
func (*InvalidLanguageCode) String ¶
func (self *InvalidLanguageCode) String() string
type Iterator ¶
type Iterator interface { Next() interface{} Err() error }
Iteration stops with Next() == nil, check Err() afterwards
func ConvertIterator ¶
ConvertIterator returns an Iterator that calls convertFunc for every non nil from.Next() result and returns the result of convertFunc for every Next().
func NewErrorOnlyIterator ¶
func NewObjectIterator ¶
func NewObjectIterator(objects ...interface{}) Iterator
func RandomIterator ¶
func SortIterator ¶
type IteratorFunc ¶
type IteratorFunc func() interface{}
func (IteratorFunc) Err ¶
func (self IteratorFunc) Err() error
func (IteratorFunc) Next ¶
func (self IteratorFunc) Next() interface{}
type Language ¶
type Language string
Attributes:
label required
func NewLanguage ¶
func (*Language) EnglishName ¶
type LimitedIterator ¶
type LimitedIterator struct { Iterator // contains filtered or unexported fields }
func NewLimitedIterator ¶
func NewLimitedIterator(iter Iterator, limit int) *LimitedIterator
func (*LimitedIterator) Next ¶
func (self *LimitedIterator) Next() interface{}
type MetaData ¶
type MetaData struct { Kind MetaDataKind Value reflect.Value Depth int // number of steps up to the root parent Name string // empty for array and slice fields Index int // will also be set for struct fields Parent *MetaData Dynamic bool // contains filtered or unexported fields }
MetaData holds meta data about an model data item.
func (*MetaData) Attrib ¶
Attrib returns the value of a tag attribute if available. Array and slice fields inherit the attributes of their named parent fields. The meaning of attributes is interpreted by the package that reads them. Attributes are defined in a struct tag named "gostart", "model" or "view" and written as name=value. Multiple attributes are separated by '|'. Example:
type Struct { X int `model:"min=0|max=10"` S []int `model:"maxlen=3|min=0|max=10" hidden int Ignore int `gostart:"-"` Z int `view:"lable=A longer label for display"` }
func (*MetaData) BoolAttrib ¶
BoolAttrib uses Attrib() to check if the value of an attribute is "true". A non existing attribibute is considered to be false.
func (*MetaData) IsIndexedValue ¶
func (*MetaData) IsModelValue ¶
func (*MetaData) IsModelValueOrChild ¶
func (*MetaData) IsNamedValue ¶
func (*MetaData) ModelValidator ¶
func (*MetaData) ModelValue ¶
func (*MetaData) NameOrIndex ¶
NameOrIndex returns self.Name if not empty or else self.Index.
func (*MetaData) NameOrWildcard ¶
NameOrWildcard returns self.Name if not empty or else the wildcard "$".
func (*MetaData) Path ¶
Path returns a slice of *MetaData that holds all parents from the root parent up to (and including) self.
func (*MetaData) RootParent ¶
func (*MetaData) Selector ¶
Selector returns the field names or indices for array/slice fields from the root parent up the the current data item concatenated with with '.'.
func (*MetaData) SelectorsMatch ¶
func (*MetaData) WildcardSelector ¶
WildcardSelector returns the field names or the wildcard '$' for array/slice fields from the root parent up the the current data item concatenated with with '.'.
type MetaDataKind ¶
type MetaDataKind int
MetaDataKind is the kind of a data item described by MetaData.
const ( StructKind MetaDataKind = iota MapKind DynamicKind ArrayKind SliceKind ValueKind // everything else, no children )
func GetMetaDataKind ¶
func GetMetaDataKind(v reflect.Value) MetaDataKind
func (MetaDataKind) HasIndexedFields ¶
func (self MetaDataKind) HasIndexedFields() bool
func (MetaDataKind) HasNamedFields ¶
func (self MetaDataKind) HasNamedFields() bool
func (MetaDataKind) String ¶
func (self MetaDataKind) String() string
type MultipleChoice ¶
type MultipleChoice []string
func (*MultipleChoice) Get ¶
func (self *MultipleChoice) Get() []string
func (*MultipleChoice) IsEmpty ¶
func (self *MultipleChoice) IsEmpty() bool
func (*MultipleChoice) IsSet ¶
func (self *MultipleChoice) IsSet(option string) bool
func (*MultipleChoice) Options ¶
func (self *MultipleChoice) Options(metaData *MetaData) []string
func (*MultipleChoice) Required ¶
func (self *MultipleChoice) Required(metaData *MetaData) bool
func (*MultipleChoice) Set ¶
func (self *MultipleChoice) Set(value ...string)
func (*MultipleChoice) SetString ¶
func (self *MultipleChoice) SetString(str string) error
func (*MultipleChoice) String ¶
func (self *MultipleChoice) String() string
func (*MultipleChoice) Validate ¶
func (self *MultipleChoice) Validate(metaData *MetaData) error
type ObjectIterator ¶
type ObjectIterator struct {
// contains filtered or unexported fields
}
func (*ObjectIterator) Err ¶
func (self *ObjectIterator) Err() error
func (*ObjectIterator) Next ¶
func (self *ObjectIterator) Next() interface{}
type Password ¶
type Password string
func NewPassword ¶
func (*Password) EqualsHashed ¶
type RequiredError ¶
type RequiredError struct {
// contains filtered or unexported fields
}
func NewRequiredError ¶
func NewRequiredError(metaData *MetaData) *RequiredError
func (RequiredError) Error ¶
func (self RequiredError) Error() string
type String ¶
type String string
func (*String) GetOrDefault ¶
type StringTooLong ¶
func (*StringTooLong) Error ¶
func (self *StringTooLong) Error() string
type StringTooShort ¶
func (*StringTooShort) Error ¶
func (self *StringTooShort) Error() string
type Time ¶
type Time int64
Time in milliseconds since January 1, year 1 00:00:00 UTC. Time values are always in UTC.
type Value ¶
type Value interface { //Init(metaData *MetaData) String() string // SetString returns only error from converting str to the // underlying value type. // It does not return validation errors of the converted value. SetString(str string) (strconvErr error) IsEmpty() bool Required(metaData *MetaData) bool Validator }
type VisitorFunc ¶
VisitorFunc calls its function for every Visitor method call, thus mapping all Visitor methods on a single function.
func (VisitorFunc) BeginIndexedFields ¶
func (self VisitorFunc) BeginIndexedFields(indexedFields *MetaData) error
func (VisitorFunc) BeginNamedFields ¶
func (self VisitorFunc) BeginNamedFields(namedFields *MetaData) error
func (VisitorFunc) EndIndexedFields ¶
func (self VisitorFunc) EndIndexedFields(indexedFields *MetaData) error
func (VisitorFunc) EndNamedFields ¶
func (self VisitorFunc) EndNamedFields(namedFields *MetaData) error
func (VisitorFunc) IndexedField ¶
func (self VisitorFunc) IndexedField(field *MetaData) error
func (VisitorFunc) NamedField ¶
func (self VisitorFunc) NamedField(field *MetaData) error
Source Files ¶
- blob.go
- bool.go
- choice.go
- color.go
- config.go
- country.go
- date.go
- datetime.go
- doc.go
- dynamicchoice.go
- dynamicvalue.go
- email.go
- emptyiterator.go
- erroronlyiterator.go
- errors.go
- fieldonlyvisitor.go
- file.go
- filteriterator.go
- float.go
- functions.go
- geolocation.go
- indexedobjectiterator.go
- int.go
- iterator.go
- iteratorfunc.go
- language.go
- limitediterator.go
- metadata.go
- multiplechoice.go
- objectiterator.go
- password.go
- phone.go
- reference.go
- string.go
- text.go
- time.go
- url.go
- validator.go
- value.go
- visitor.go
- visitorfunc.go