validator

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "v0.1.1"

Functions

func IsBaseType

func IsBaseType(f *protogen.Field) bool

func ParamsToArgs

func ParamsToArgs(params string) []string

Types

type Generator

type Generator struct {
	*protogen.Plugin
	*protogen.GeneratedFile
	PbFile *protogen.File
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(plu *protogen.Plugin, file *protogen.File) (*Generator, error)

func (*Generator) Generate

func (g *Generator) Generate() error

func (*Generator) Pf

func (g *Generator) Pf(format string, a ...interface{})

Pf wraps P() for format write

type ValidateContext

type ValidateContext struct {
	*parser.Validation
	RawField     *protogen.Field
	PbFile       *protogen.File
	Msg          *protogen.Message
	FieldName    string // Go name for field
	RawFieldName string // raw field name in idl
	GetNameFunc  string // Get***() func for getting the generated value
	IsOptional   bool
	// contains filtered or unexported fields
}

func (*ValidateContext) GenID

func (v *ValidateContext) GenID(prefix string) (name string)

Jump to

Keyboard shortcuts

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