mapper

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	State              = "state"
	SizeCache          = "sizeCache"
	UnknownFields      = "unknownFields"
	ProtobufTag        = "protobuf"
	ProtobufOneOf      = "oneof"
	ProtobufNamePrefix = "name="
	JSONTag            = "json"
	JSONOmitempty      = "omitempty"
)

Protobuf fields generated by the protoc compiler

Variables

View Source
var (
	MissingProtobufTagError       = "missing protobuf tag: %s"
	MissingProtobufTagNameError   = "missing protobuf tag name: %s"
	DuplicateProtobufTagNameError = "duplicate protobuf tag name: %s"
	MissingJSONTagError           = "missing json tag: %s"
	EmptyJSONTagError             = "empty json tag: %s"
	DuplicateJSONTagNameError     = "duplicate json tag name: %s"
)

Functions

This section is empty.

Types

type Mapper

type Mapper struct {
	Fields        map[string]string // Key is the field name and value is the name used in the validation error
	NestedMappers map[string]*Mapper
}

Mapper is a map of fields to validate from a struct

func CreateJSONMapper

func CreateJSONMapper(structInstance interface{}, mode *goflagsmode.Flag) (
	*Mapper,
	error,
)

CreateJSONMapper creates the fields to validate from a JSON struct

func CreateProtobufMapper

func CreateProtobufMapper(structInstance interface{}, mode *goflagsmode.Flag) (
	*Mapper,
	error,
)

CreateProtobufMapper creates the fields to validate from a Protobuf compiled struct

Jump to

Keyboard shortcuts

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