Documentation ¶
Index ¶
- func Disabled(msg pgs.Message) (disabled bool, err error)
- 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 Register(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 Func
- func (fn Func) Accessor(ctx RuleContext) string
- func (fn Func) ByteStr(x []byte) string
- func (fn Func) DurationGt(a, b *duration.Duration) bool
- func (fn Func) DurationLit(dur *duration.Duration) string
- func (fn Func) DurationStr(dur *duration.Duration) string
- func (fn Func) EnumPackages(enums []pgs.Enum) map[pgs.FilePath]pgs.Name
- func (fn Func) Error(ctx RuleContext, reason ...interface{}) string
- func (fn Func) ErrorCause(ctx RuleContext, cause string, reason ...interface{}) string
- func (fn Func) ErrorIdx(ctx RuleContext, idx string, reason ...interface{}) string
- func (fn Func) ErrorIdxCause(ctx RuleContext, idx, cause string, reason ...interface{}) string
- func (fn Func) ErrorName(m pgs.Message) pgs.Name
- func (fn Func) ExternalEnums(file pgs.File) []pgs.Enum
- func (fn Func) InKey(f pgs.Field, x interface{}) string
- func (fn Func) InType(f pgs.Field, x interface{}) string
- func (fn Func) IsBytes(f interface{ ... }) bool
- func (fn Func) Lit(x interface{}) string
- func (fn Func) Lookup(f pgs.Field, name string) string
- func (fn Func) MessageType(message pgs.Message) pgsgo.TypeName
- func (fn Func) OneOfTypeName(f pgs.Field) pgsgo.TypeName
- func (fn Func) Optional(f pgs.Field) bool
- func (fn Func) SnakeCase(name string) string
- func (fn Func) TimestampGt(a, b *timestamp.Timestamp) bool
- func (fn Func) TimestampLit(ts *timestamp.Timestamp) string
- func (fn Func) TimestampStr(ts *timestamp.Timestamp) string
- func (fn Func) Unwrap(ctx RuleContext, name string) (RuleContext, error)
- type RuleContext
- type WellKnown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Func ¶
func (Func) Accessor ¶
func (fn Func) Accessor(ctx RuleContext) string
func (Func) Error ¶
func (fn Func) Error(ctx RuleContext, reason ...interface{}) string
func (Func) ErrorCause ¶
func (fn Func) ErrorCause(ctx RuleContext, cause string, reason ...interface{}) string
func (Func) ErrorIdx ¶
func (fn Func) ErrorIdx(ctx RuleContext, idx string, reason ...interface{}) string
func (Func) ErrorIdxCause ¶
func (fn Func) ErrorIdxCause(ctx RuleContext, idx, cause string, reason ...interface{}) string
func (Func) Unwrap ¶
func (fn Func) Unwrap(ctx RuleContext, name string) (RuleContext, error)
type RuleContext ¶
type RuleContext struct { Field pgs.Field Rules proto.Message MessageRules *validate.MessageRules Typ string WrapperTyp string CustomError string OnKey bool Index string AccessorOverride string }
func RulesContext ¶
func RulesContext(f pgs.Field) (out RuleContext, err error)
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)
Click to show internal directories.
Click to hide internal directories.