validator

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidatorCall

func GetValidatorCall(options *Options, receiver string) (string, error)

Types

type Kind

type Kind int

Kind defines which package will be used to create the validator call.

const (
	KindOzzo Kind = iota
)

type Options

type Options struct {
	Dive              bool
	Required          bool
	Each              bool
	Kind              Kind
	Format            extensionpb.FieldValidationFormat
	Pattern           string
	Min               interface{}
	Max               interface{}
	MaxLength         interface{}
	RequiredCondition *RequiredRuleOptions
}

type RequiredFieldRuleOptions

type RequiredFieldRuleOptions struct {
	FieldName string
	Value     string
	Type      descriptor.FieldDescriptorProto_Type
	TypeName  string
}

type RequiredRuleOptions

type RequiredRuleOptions struct {
	Rules                      []*RequiredFieldRuleOptions
	Negative                   bool
	UsePrefixCondition         bool
	ErrorMessage               string
	DefaultConditionOperation  string
	NegativeConditionOperation string
	RuleConditionOperation     string
}

Jump to

Keyboard shortcuts

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