service

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilService = errors.New("mapper validator service cannot be nil")
)

Functions

This section is empty.

Types

type DefaultService added in v0.3.4

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

DefaultService struct

func NewDefaultService added in v0.3.4

func NewDefaultService(
	parser govalidatormapperparser.Parser,
	validator govalidatormappervalidator.Validator,
	mode *goflagmode.Flag,
) (*DefaultService, error)

NewDefaultService creates a new default validator service

func (*DefaultService) ModeFlag added in v0.3.4

func (d *DefaultService) ModeFlag() *goflagmode.Flag

ModeFlag returns the mode flag

func (*DefaultService) ParseValidations added in v0.4.0

func (d *DefaultService) ParseValidations(
	validations govalidatormappervalidations.Validations,
) (interface{}, error)

ParseValidations parses the validations

func (*DefaultService) RunAndParseValidations added in v0.4.1

func (d *DefaultService) RunAndParseValidations(
	getValidationsFn func(govalidatormappervalidations.Validations) error,
) (interface{}, error)

RunAndParseValidations runs and parses the validations

func (*DefaultService) ValidateNilFields added in v0.3.4

func (d *DefaultService) ValidateNilFields(
	validations govalidatormappervalidations.Validations,
	request interface{},
	mapper *govalidatormapper.Mapper,
) error

ValidateNilFields validates the nil fields

type Service

type Service interface {
	ModeFlag() *goflagmode.Flag
	ValidateNilFields(
		validations govalidatormappervalidations.Validations,
		request interface{},
		mapper *govalidatormapper.Mapper,
	) error
	ParseValidations(validations govalidatormappervalidations.Validations) (
		interface{},
		error,
	)
	RunAndParseValidations(
		getValidationsFn func(govalidatormappervalidations.Validations) error,
	) (interface{}, error)
}

Service interface for the validator service

Jump to

Keyboard shortcuts

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