Documentation ¶
Index ¶
Constants ¶
View Source
const ( Required = "required" Invalid = "invalid" IsNotInreger = "is_not_integer" )
View Source
const DateLayout = "2006-01-02"
Variables ¶
View Source
var ( ErrNotFound = NewError("operation.not_found") ErrBadNumber = NewError("query.bad_number") ErrBadVIN = NewError("query.bad_vin") ErrBadCode = NewError("query.bad_code") )
Functions ¶
func ErrorMessages ¶ added in v0.1.35
func ToSnakeCase ¶ added in v0.1.35
func Validate ¶ added in v0.1.35
func Validate(v validation.Validatable, prefix string) error
Types ¶
type Registration ¶
type Registration struct { Brand *string `json:"brand,omitempty"` Capacity *int `json:"capacity,omitempty"` Color string `json:"color"` FirstRegDate *string `json:"first_reg_date,omitempty"` Date *string `json:"date,omitempty"` Fuel *string `json:"fuel,omitempty"` Kind *string `json:"kind,omitempty"` Year int `json:"year"` Model *string `json:"model,omitempty"` DocumentNumber string `json:"-"` DocumentSeries string `json:"-"` Code string `json:"code"` Number string `json:"number"` NumSeating *int `json:"num_seating,omitempty"` NumStanding *int `json:"num_standing,omitempty"` OwnWeight *float64 `json:"own_weight,omitempty"` RankCategory *string `json:"rank_category,omitempty"` TotalWeight *float64 `json:"total_weight,omitempty"` VIN *string `json:"vin,omitempty"` IsActive *bool `json:"is_active,omitempty"` }
func TestRegistration ¶
func TestRegistration(t *testing.T) *Registration
TestRegistration returns example registration.
func (*Registration) Schema ¶
func (r *Registration) Schema() *vehicle.Registration
type ValidationError ¶
func NewValidationError ¶
func NewValidationError(messages map[string][]string) ValidationError
func (*ValidationError) Append ¶
func (e *ValidationError) Append(field string, message ...string)
func (ValidationError) Error ¶
func (e ValidationError) Error() string
func (ValidationError) WithPrefix ¶
func (e ValidationError) WithPrefix(prefix string) ValidationError
Click to show internal directories.
Click to hide internal directories.