validator

package
v3.0.8-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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"`
}

func ParseEnumOption

func ParseEnumOption(val interface{}) []EnumVal

ParseEnumOption convert val to []EnumVal

type InstRst

type InstRst struct {
	Result  bool        `json:"result"`
	Code    int         `json:"code"`
	Message interface{} `json:"message"`
	Data    interface{} `json:"data"`
}

InstRst define

type IntOption

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

type MetaRst

type MetaRst struct {
	Result  bool                     `json:result`
	Code    int                      `json:code`
	Message interface{}              `json:message`
	Data    []map[string]interface{} `json:data`
}

type ValRule

type ValRule struct {
	IsRequireArr   []string
	IsOnlyArr      []string
	AllFiledArr    []string
	NoEnumFiledArr []string
	PropertyKv     map[string]string
	FieldRule      map[string]map[string]interface{}

	AllFieldAttDes []api.ObjAttDes
	// contains filtered or unexported fields
}

func NewValRule

func NewValRule(ownerID, objCtrl string) *ValRule

func (*ValRule) GetObjAttrByID

func (valid *ValRule) GetObjAttrByID(forward *api.ForwardParam, objID string) error

type ValidMap

type ValidMap struct {
	IsRequireArr []string
	IsOnlyArr    []string
	KeyFileds    map[string]interface{}
	PropertyKv   map[string]string
	// contains filtered or unexported fields
}

func NewValidMap

func NewValidMap(ownerID, objID, objCtrl string, forward *api.ForwardParam, err errors.DefaultCCErrorIf) *ValidMap

NewValidMap returns new NewValidMap

func NewValidMapWithKeyFields

func NewValidMapWithKeyFields(ownerID, objID, objCtrl string, keyFileds []string, forward *api.ForwardParam, err errors.DefaultCCErrorIf) *ValidMap

NewValidMapWithKeyFields returns new NewValidMap

func (*ValidMap) ValidMap

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

ValidMap basic valid

Jump to

Keyboard shortcuts

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