Documentation
¶
Index ¶
- Variables
- func NewValidateBuilder() *ruleState
- func SetMessage(msg string) *string
- func SetTotal(total int64) *int64
- type ChainResultType
- type ChainerType
- type CustomMsg
- type EnumField
- type ExtensionType
- type ExtraOperationData
- type ExtraOperationType
- type FileRequest
- type MessageMeta
- type Rules
- type RulesWrapper
- func (rw *RulesWrapper) Done() RulesWrapper
- func (rw *RulesWrapper) SetFieldsManipulator(fields []string, fun func(data interface{}) (result interface{}, err error)) *RulesWrapper
- func (rw *RulesWrapper) SetManipulator(field string, fun func(data interface{}) (result interface{}, err error)) *RulesWrapper
- func (rw *RulesWrapper) SetRule(field string, rule Rules) *RulesWrapper
- func (rw *RulesWrapper) SetSetting(setting Setting) *RulesWrapper
- type Setting
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewValidateBuilder ¶
func NewValidateBuilder() *ruleState
func SetMessage ¶ added in v0.0.18
Types ¶
type ChainResultType ¶ added in v0.0.31
type ChainerType ¶ added in v0.0.31
type ChainerType interface { GetParentKey() string Next(index int) ChainerType Back() ChainerType Forward(index int) ChainerType SetKey(name string) ChainerType GetKey() string SetKeyValue(key string, value interface{}) ChainerType GetParentKeys() []string AddChild() ChainerType LoadFromMap(data map[string]interface{}) SetValue(value interface{}) ChainerType GetValue() interface{} SetManipulator(manipulator *func(interface{}) (interface{}, error)) ChainerType SetUniques(uniques []string) ChainerType SetCustomMsg(customMsg *CustomMsg) ChainerType GetUniques() []string AddError(err error) ChainerType GetResult() ChainResultType GetChildren() []ChainerType GetParent() ChainerType GetBrothers() []ChainerType }
type ExtensionType ¶ added in v0.0.20
type ExtensionType interface { SetRoles(rules RulesWrapper) BeforeLoad(data interface{}) error AfterLoad(data *map[string]interface{}) error BeforeValidation(data *map[string]interface{}) error AfterValidation(data *map[string]interface{}) error SetExtraData(data *ExtraOperationData) ExtensionType }
type ExtraOperationData ¶ added in v0.0.20
type ExtraOperationData struct {
// contains filtered or unexported fields
}
func (*ExtraOperationData) Bind ¶ added in v0.0.20
func (state *ExtraOperationData) Bind(i interface{}) error
func (*ExtraOperationData) GetData ¶ added in v0.0.20
func (state *ExtraOperationData) GetData() map[string]interface{}
func (*ExtraOperationData) GetFilledField ¶ added in v0.0.20
func (state *ExtraOperationData) GetFilledField() []string
func (*ExtraOperationData) GetNullField ¶ added in v0.0.20
func (state *ExtraOperationData) GetNullField() []string
type ExtraOperationType ¶ added in v0.0.20
type FileRequest ¶
type FileRequest struct { File multipart.File FileInfo *multipart.FileHeader }
type MessageMeta ¶ added in v0.0.18
type Rules ¶
type Rules struct { Null bool NilIfNull bool AnonymousObject bool Email bool Enum *EnumField[any] Type reflect.Kind Max *int64 Min *int64 IfNull interface{} UUID bool UUIDToString bool IPV4 bool IPV4Network bool IPv4OptionalPrefix bool File bool RegexString string Unique []string RequiredWithout []string RequiredIf []string Object *RulesWrapper ListObject *RulesWrapper CustomMsg CustomMsg // will support soon }
type RulesWrapper ¶ added in v0.0.22
type RulesWrapper struct { Rules map[string]Rules Setting Setting // contains filtered or unexported fields }
func BuildRoles ¶ added in v0.0.31
func BuildRoles() *RulesWrapper
func (*RulesWrapper) Done ¶ added in v0.0.31
func (rw *RulesWrapper) Done() RulesWrapper
func (*RulesWrapper) SetFieldsManipulator ¶ added in v0.0.34
func (rw *RulesWrapper) SetFieldsManipulator(fields []string, fun func(data interface{}) (result interface{}, err error)) *RulesWrapper
func (*RulesWrapper) SetManipulator ¶ added in v0.0.31
func (rw *RulesWrapper) SetManipulator(field string, fun func(data interface{}) (result interface{}, err error)) *RulesWrapper
func (*RulesWrapper) SetRule ¶ added in v0.0.31
func (rw *RulesWrapper) SetRule(field string, rule Rules) *RulesWrapper
func (*RulesWrapper) SetSetting ¶ added in v0.0.34
func (rw *RulesWrapper) SetSetting(setting Setting) *RulesWrapper
Click to show internal directories.
Click to hide internal directories.