package shared
import "github.com/envoyproxy/protoc-gen-validate/templates/shared"
Index ¶
- func Disabled(msg pgs.Message) (disabled bool, err error)
- func FileNeeds(f pgs.File, wk WellKnown) bool
- func Has(msg proto.Message, fld string) bool
- func Ignored(msg pgs.Message) (ignored bool, err error)
- func Needs(m pgs.Message, wk WellKnown) bool
- func RegisterFunctions(tpl *template.Template, params pgs.Parameters)
- func Render(tpl *template.Template) func(ctx RuleContext) (string, error)
- func RequiredOneOf(oo pgs.OneOf) (required bool, err error)
- type RuleContext
- func (ctx RuleContext) Elem(name, idx string) (out RuleContext, err error)
- func (ctx RuleContext) Key(name, idx string) (out RuleContext, err error)
- func (ctx RuleContext) Unwrap(name string) (out RuleContext, err error)
- type WellKnown
Functions ¶
func Disabled ¶
Disabled returns true if validations are disabled for msg
func FileNeeds ¶
func Has ¶
Has returns true if the provided Message has the a field fld.
func Ignored ¶
Ignore returns true if validations aren't to be generated for msg
func Needs ¶
Needs returns true if a well-known string validator is needed for this message.
func RegisterFunctions ¶
func RegisterFunctions(tpl *template.Template, params pgs.Parameters)
func Render ¶
func Render(tpl *template.Template) func(ctx RuleContext) (string, error)
func RequiredOneOf ¶
RequiredOneOf returns true if the oneof field requires a field to be set
Types ¶
type RuleContext ¶
type RuleContext struct { Field pgs.Field Rules proto.Message MessageRules *validate.MessageRules Typ string WrapperTyp string OnKey bool Index string AccessorOverride string }
func (RuleContext) Elem ¶
func (ctx RuleContext) Elem(name, idx string) (out RuleContext, err error)
func (RuleContext) Key ¶
func (ctx RuleContext) Key(name, idx string) (out RuleContext, err error)
func (RuleContext) Unwrap ¶
func (ctx RuleContext) Unwrap(name string) (out RuleContext, err error)
type WellKnown ¶
type WellKnown string
Source Files ¶
context.go disabled.go enums.go functions.go reflection.go well_known.go
- Version
- v1.2.1 (latest)
- Published
- Jan 22, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 4 hours ago –
Tools for package owners.