validator

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GooKitValidator

type GooKitValidator struct {
	StopOnError bool
}

func NewGooKitValidator

func NewGooKitValidator() *GooKitValidator

func (*GooKitValidator) GetConfiguredValidator

func (c *GooKitValidator) GetConfiguredValidator(toValidate any, scene ...string) *validate.Validation

GetConfiguredValidator returns validate.Validation instance with required_uuid validator

func (*GooKitValidator) Validate

func (c *GooKitValidator) Validate(i interface{}) error

func (*GooKitValidator) ValidateStruct

func (c *GooKitValidator) ValidateStruct(toValidate any, scene ...string) error

ValidateStruct validates struct fulfill validate tags validations

It adds a custom required validation:

  • required_uuid

This was created to validate uuid.UUID type from google UUID package.

type ValidationError

type ValidationError struct {
	Errors interface{} `json:"errors,inline"`
}

func (*ValidationError) Error

func (c *ValidationError) Error() string

func (*ValidationError) StatusCode

func (c *ValidationError) StatusCode() int

Jump to

Keyboard shortcuts

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