Documentation ¶
Overview ¶
Package validators helper functions for validate params
Index ¶
- type Metric
- func (p *Metric) GetMetricValue(metric string) (value string, exist bool)
- func (p *Metric) ValidateFloat(base *field.Path, metric string, min, max *float64) (errs field.ErrorList)
- func (p *Metric) ValidateInt(base *field.Path, metric string, min, max *int) (errs field.ErrorList)
- func (p *Metric) ValidateStringEnums(base *field.Path, metric string, enums ...string) (errs field.ErrorList)
- type URL
- type ValidateURLFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
Metric help to validate metrics
func (*Metric) GetMetricValue ¶
GetMetricValue get metric value
func (*Metric) ValidateFloat ¶
func (p *Metric) ValidateFloat(base *field.Path, metric string, min, max *float64) (errs field.ErrorList)
ValidateFloat help to validate float metrics
func (*Metric) ValidateInt ¶
ValidateInt help to validate int metrics
type URL ¶
type URL struct {
// contains filtered or unexported fields
}
URL help to validate url
func (*URL) SetValidate ¶
func (p *URL) SetValidate(f ValidateURLFunc) *URL
SetValidate customize validate function
Click to show internal directories.
Click to hide internal directories.