parametervalidation

package
v0.0.0-...-1b29172 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegExFilePath = "/etc/common/ParameterValidator.json"

RegExFilePath ... path to read RegEx in production

Functions

func GetDomainFieldName

func GetDomainFieldName(rpc string, rpcFieldName string) string

GetDomainFieldName returns the mapped domain field name of a given rpc field

func RPCParameterValidator

func RPCParameterValidator(ctx context.Context,
	req interface{},
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler) (interface{}, error)

RPCParameterValidator is an example of unary server interceptor

Types

type ValidationConfiguration

type ValidationConfiguration struct {
	RegExp         string
	MinLength      int
	MaxLength      int
	ErrDescription string
}

ValidationConfiguration ... regEx structure

func GetValidationConfiguration

func GetValidationConfiguration(key string) *ValidationConfiguration

GetValidationConfiguration returns the validation configuration for a given field

Jump to

Keyboard shortcuts

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