Help us shape the future of Go! Take the 2026 Go Developer Survey

validate

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatErrorFunc

type FormatErrorFunc func(target interface{}, err validator.FieldError) string

type Validator

type Validator struct {
	FormatErrorFuncMap map[string]FormatErrorFunc
	FormatNameFunc     func(name string) string
	// contains filtered or unexported fields
}

func New

func New(service services.Service) *Validator

func (*Validator) RegisterCollectionValidator

func (v *Validator) RegisterCollectionValidator(key string, allowedValues []string)

RegisterCollectionValidator 要素/コレクションを示すキーに対しそれぞれoneofエイリアスを登録する

func (*Validator) Struct

func (v *Validator) Struct(value interface{}) error

Struct 対象structを検証しerrorを返す

func (*Validator) StructWithMultiError

func (v *Validator) StructWithMultiError(value interface{}) *multierror.Error

StructWithMultiError 対象structを検証し、*multierror.Errorを返す

Jump to

Keyboard shortcuts

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