validator

package
v0.0.0-...-28c23ed Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

func Validate

func Validate(ctx context.Context, data any, handler func(context.Context, error) error) (err error)

Types

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(field, reason string) ValidationError

func NewErrorWithCause

func NewErrorWithCause(field, reason string, cause error) ValidationError

func (ValidationError) Error

func (e ValidationError) Error() string

func (ValidationError) Field

func (e ValidationError) Field() string

func (ValidationError) Reason

func (e ValidationError) Reason() string

type ValidationMultiError

type ValidationMultiError []error

func NewMultiError

func NewMultiError(errs ...error) ValidationMultiError

func (ValidationMultiError) AllErrors

func (m ValidationMultiError) AllErrors() []error

func (ValidationMultiError) Error

func (m ValidationMultiError) Error() string

Jump to

Keyboard shortcuts

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