validator

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillLostedFieldValue

func FillLostedFieldValue(valData map[string]interface{}, propertys []metadata.Attribute, ignorefields []string)

FillLostedFieldValue fill the value in inst map data

Types

type EnumOption

type EnumOption []EnumVal

EnumOption enum option

func ParseEnumOption

func ParseEnumOption(val interface{}) EnumOption

ParseEnumOption convert val to []EnumVal

func (EnumOption) GetDefault

func (opt EnumOption) GetDefault() *EnumVal

GetDefault returns EnumOption's default value

type EnumVal

type EnumVal struct {
	ID        string `bson:"id"           json:"id"`
	Name      string `bson:"name"         json:"name"`
	Type      string `bson:"type"         json:"type"`
	IsDefault bool   `bson:"is_default"   json:"is_default"`
}

EnumVal enum option val

type IntOption

type IntOption struct {
	Min string `bson:"min" json:"min"`
	Max string `bson:"max" json:"max"`
}

IntOption integer option

type ValidMap

type ValidMap struct {
	*backbone.Engine
	// contains filtered or unexported fields
}

ValidMap define

func NewValidMap

func NewValidMap(ownerID, objID string, pheader http.Header, engine *backbone.Engine) *ValidMap

NewValidMap returns new NewValidMap

func NewValidMapWithKeyFields

func NewValidMapWithKeyFields(ownerID, objID string, ignoreFields []string, pheader http.Header, engine *backbone.Engine) *ValidMap

NewValidMapWithKeyFields returns new NewValidMap

func (*ValidMap) Init

func (valid *ValidMap) Init() error

Init init

func (*ValidMap) ValidMap

func (valid *ValidMap) ValidMap(valData map[string]interface{}, validType string, instID int64) error

ValidMap basic valid

Jump to

Keyboard shortcuts

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