validator

package
v3.0.6-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: MIT Imports: 12 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 {
	Name      string `json:"name"`
	Type      string `json:"type"`
	IsDefault bool   `json:"is_default"`
}

type InstRst

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

type IntOption

type IntOption struct {
	Min string `json:min`
	Max string `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{}
	// contains filtered or unexported fields
}

func NewValRule

func NewValRule(ownerID, objCtrl string) *ValRule

func (*ValRule) GetObjAttrByID

func (valid *ValRule) GetObjAttrByID(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, err errors.DefaultCCErrorIf) *ValidMap

func NewValidMapWithKeyFileds

func NewValidMapWithKeyFileds(ownerID, objID, objCtrl string, keyFileds []string, err errors.DefaultCCErrorIf) *ValidMap

func (*ValidMap) ValidMap

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

basic valid

Jump to

Keyboard shortcuts

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