Documentation
¶
Index ¶
- Constants
- Variables
- type AnyRules
- func (x *AnyRules) GetIn() []string
- func (x *AnyRules) GetNotIn() []string
- func (*AnyRules) ProtoMessage()
- func (x *AnyRules) ProtoReflect() protoreflect.Message
- func (x *AnyRules) Reset()
- func (x *AnyRules) SetIn(v []string)
- func (x *AnyRules) SetNotIn(v []string)
- func (x *AnyRules) String() string
- type AnyRules_builder
- type BoolRules
- func (x *BoolRules) ClearConst()
- func (x *BoolRules) GetConst() bool
- func (x *BoolRules) GetExample() []bool
- func (x *BoolRules) HasConst() bool
- func (*BoolRules) ProtoMessage()
- func (x *BoolRules) ProtoReflect() protoreflect.Message
- func (x *BoolRules) Reset()
- func (x *BoolRules) SetConst(v bool)
- func (x *BoolRules) SetExample(v []bool)
- func (x *BoolRules) String() string
- type BoolRules_builder
- type BytesRules
- func (x *BytesRules) ClearConst()
- func (x *BytesRules) ClearContains()
- func (x *BytesRules) ClearIp()
- func (x *BytesRules) ClearIpv4()
- func (x *BytesRules) ClearIpv6()
- func (x *BytesRules) ClearLen()
- func (x *BytesRules) ClearMaxLen()
- func (x *BytesRules) ClearMinLen()
- func (x *BytesRules) ClearPattern()
- func (x *BytesRules) ClearPrefix()
- func (x *BytesRules) ClearSuffix()
- func (x *BytesRules) ClearUuid()
- func (x *BytesRules) ClearWellKnown()
- func (x *BytesRules) GetConst() []byte
- func (x *BytesRules) GetContains() []byte
- func (x *BytesRules) GetExample() [][]byte
- func (x *BytesRules) GetIn() [][]byte
- func (x *BytesRules) GetIp() bool
- func (x *BytesRules) GetIpv4() bool
- func (x *BytesRules) GetIpv6() bool
- func (x *BytesRules) GetLen() uint64
- func (x *BytesRules) GetMaxLen() uint64
- func (x *BytesRules) GetMinLen() uint64
- func (x *BytesRules) GetNotIn() [][]byte
- func (x *BytesRules) GetPattern() string
- func (x *BytesRules) GetPrefix() []byte
- func (x *BytesRules) GetSuffix() []byte
- func (x *BytesRules) GetUuid() bool
- func (x *BytesRules) GetWellKnown() isBytesRules_WellKnown
- func (x *BytesRules) HasConst() bool
- func (x *BytesRules) HasContains() bool
- func (x *BytesRules) HasIp() bool
- func (x *BytesRules) HasIpv4() bool
- func (x *BytesRules) HasIpv6() bool
- func (x *BytesRules) HasLen() bool
- func (x *BytesRules) HasMaxLen() bool
- func (x *BytesRules) HasMinLen() bool
- func (x *BytesRules) HasPattern() bool
- func (x *BytesRules) HasPrefix() bool
- func (x *BytesRules) HasSuffix() bool
- func (x *BytesRules) HasUuid() bool
- func (x *BytesRules) HasWellKnown() bool
- func (*BytesRules) ProtoMessage()
- func (x *BytesRules) ProtoReflect() protoreflect.Message
- func (x *BytesRules) Reset()
- func (x *BytesRules) SetConst(v []byte)
- func (x *BytesRules) SetContains(v []byte)
- func (x *BytesRules) SetExample(v [][]byte)
- func (x *BytesRules) SetIn(v [][]byte)
- func (x *BytesRules) SetIp(v bool)
- func (x *BytesRules) SetIpv4(v bool)
- func (x *BytesRules) SetIpv6(v bool)
- func (x *BytesRules) SetLen(v uint64)
- func (x *BytesRules) SetMaxLen(v uint64)
- func (x *BytesRules) SetMinLen(v uint64)
- func (x *BytesRules) SetNotIn(v [][]byte)
- func (x *BytesRules) SetPattern(v string)
- func (x *BytesRules) SetPrefix(v []byte)
- func (x *BytesRules) SetSuffix(v []byte)
- func (x *BytesRules) SetUuid(v bool)
- func (x *BytesRules) String() string
- func (x *BytesRules) WhichWellKnown() case_BytesRules_WellKnown
- type BytesRules_Ip
- type BytesRules_Ipv4
- type BytesRules_Ipv6
- type BytesRules_Uuid
- type BytesRules_builder
- type DoubleRules
- func (x *DoubleRules) ClearConst()
- func (x *DoubleRules) ClearFinite()
- func (x *DoubleRules) ClearGreaterThan()
- func (x *DoubleRules) ClearGt()
- func (x *DoubleRules) ClearGte()
- func (x *DoubleRules) ClearLessThan()
- func (x *DoubleRules) ClearLt()
- func (x *DoubleRules) ClearLte()
- func (x *DoubleRules) GetConst() float64
- func (x *DoubleRules) GetExample() []float64
- func (x *DoubleRules) GetFinite() bool
- func (x *DoubleRules) GetGreaterThan() isDoubleRules_GreaterThan
- func (x *DoubleRules) GetGt() float64
- func (x *DoubleRules) GetGte() float64
- func (x *DoubleRules) GetIn() []float64
- func (x *DoubleRules) GetLessThan() isDoubleRules_LessThan
- func (x *DoubleRules) GetLt() float64
- func (x *DoubleRules) GetLte() float64
- func (x *DoubleRules) GetNotIn() []float64
- func (x *DoubleRules) HasConst() bool
- func (x *DoubleRules) HasFinite() bool
- func (x *DoubleRules) HasGreaterThan() bool
- func (x *DoubleRules) HasGt() bool
- func (x *DoubleRules) HasGte() bool
- func (x *DoubleRules) HasLessThan() bool
- func (x *DoubleRules) HasLt() bool
- func (x *DoubleRules) HasLte() bool
- func (*DoubleRules) ProtoMessage()
- func (x *DoubleRules) ProtoReflect() protoreflect.Message
- func (x *DoubleRules) Reset()
- func (x *DoubleRules) SetConst(v float64)
- func (x *DoubleRules) SetExample(v []float64)
- func (x *DoubleRules) SetFinite(v bool)
- func (x *DoubleRules) SetGt(v float64)
- func (x *DoubleRules) SetGte(v float64)
- func (x *DoubleRules) SetIn(v []float64)
- func (x *DoubleRules) SetLt(v float64)
- func (x *DoubleRules) SetLte(v float64)
- func (x *DoubleRules) SetNotIn(v []float64)
- func (x *DoubleRules) String() string
- func (x *DoubleRules) WhichGreaterThan() case_DoubleRules_GreaterThan
- func (x *DoubleRules) WhichLessThan() case_DoubleRules_LessThan
- type DoubleRules_Gt
- type DoubleRules_Gte
- type DoubleRules_Lt
- type DoubleRules_Lte
- type DoubleRules_builder
- type DurationRules
- func (x *DurationRules) ClearConst()
- func (x *DurationRules) ClearGreaterThan()
- func (x *DurationRules) ClearGt()
- func (x *DurationRules) ClearGte()
- func (x *DurationRules) ClearLessThan()
- func (x *DurationRules) ClearLt()
- func (x *DurationRules) ClearLte()
- func (x *DurationRules) GetConst() *durationpb.Duration
- func (x *DurationRules) GetExample() []*durationpb.Duration
- func (x *DurationRules) GetGreaterThan() isDurationRules_GreaterThan
- func (x *DurationRules) GetGt() *durationpb.Duration
- func (x *DurationRules) GetGte() *durationpb.Duration
- func (x *DurationRules) GetIn() []*durationpb.Duration
- func (x *DurationRules) GetLessThan() isDurationRules_LessThan
- func (x *DurationRules) GetLt() *durationpb.Duration
- func (x *DurationRules) GetLte() *durationpb.Duration
- func (x *DurationRules) GetNotIn() []*durationpb.Duration
- func (x *DurationRules) HasConst() bool
- func (x *DurationRules) HasGreaterThan() bool
- func (x *DurationRules) HasGt() bool
- func (x *DurationRules) HasGte() bool
- func (x *DurationRules) HasLessThan() bool
- func (x *DurationRules) HasLt() bool
- func (x *DurationRules) HasLte() bool
- func (*DurationRules) ProtoMessage()
- func (x *DurationRules) ProtoReflect() protoreflect.Message
- func (x *DurationRules) Reset()
- func (x *DurationRules) SetConst(v *durationpb.Duration)
- func (x *DurationRules) SetExample(v []*durationpb.Duration)
- func (x *DurationRules) SetGt(v *durationpb.Duration)
- func (x *DurationRules) SetGte(v *durationpb.Duration)
- func (x *DurationRules) SetIn(v []*durationpb.Duration)
- func (x *DurationRules) SetLt(v *durationpb.Duration)
- func (x *DurationRules) SetLte(v *durationpb.Duration)
- func (x *DurationRules) SetNotIn(v []*durationpb.Duration)
- func (x *DurationRules) String() string
- func (x *DurationRules) WhichGreaterThan() case_DurationRules_GreaterThan
- func (x *DurationRules) WhichLessThan() case_DurationRules_LessThan
- type DurationRules_Gt
- type DurationRules_Gte
- type DurationRules_Lt
- type DurationRules_Lte
- type DurationRules_builder
- type EnumRules
- func (x *EnumRules) ClearConst()
- func (x *EnumRules) ClearDefinedOnly()
- func (x *EnumRules) GetConst() int32
- func (x *EnumRules) GetDefinedOnly() bool
- func (x *EnumRules) GetExample() []int32
- func (x *EnumRules) GetIn() []int32
- func (x *EnumRules) GetNotIn() []int32
- func (x *EnumRules) HasConst() bool
- func (x *EnumRules) HasDefinedOnly() bool
- func (*EnumRules) ProtoMessage()
- func (x *EnumRules) ProtoReflect() protoreflect.Message
- func (x *EnumRules) Reset()
- func (x *EnumRules) SetConst(v int32)
- func (x *EnumRules) SetDefinedOnly(v bool)
- func (x *EnumRules) SetExample(v []int32)
- func (x *EnumRules) SetIn(v []int32)
- func (x *EnumRules) SetNotIn(v []int32)
- func (x *EnumRules) String() string
- type EnumRules_builder
- type FieldMaskRules
- func (x *FieldMaskRules) ClearConst()
- func (x *FieldMaskRules) GetConst() *fieldmaskpb.FieldMask
- func (x *FieldMaskRules) GetExample() []*fieldmaskpb.FieldMask
- func (x *FieldMaskRules) GetIn() []string
- func (x *FieldMaskRules) GetNotIn() []string
- func (x *FieldMaskRules) HasConst() bool
- func (*FieldMaskRules) ProtoMessage()
- func (x *FieldMaskRules) ProtoReflect() protoreflect.Message
- func (x *FieldMaskRules) Reset()
- func (x *FieldMaskRules) SetConst(v *fieldmaskpb.FieldMask)
- func (x *FieldMaskRules) SetExample(v []*fieldmaskpb.FieldMask)
- func (x *FieldMaskRules) SetIn(v []string)
- func (x *FieldMaskRules) SetNotIn(v []string)
- func (x *FieldMaskRules) String() string
- type FieldMaskRules_builder
- type FieldPath
- type FieldPathElement
- func (x *FieldPathElement) ClearBoolKey()
- func (x *FieldPathElement) ClearFieldName()
- func (x *FieldPathElement) ClearFieldNumber()
- func (x *FieldPathElement) ClearFieldType()
- func (x *FieldPathElement) ClearIndex()
- func (x *FieldPathElement) ClearIntKey()
- func (x *FieldPathElement) ClearKeyType()
- func (x *FieldPathElement) ClearStringKey()
- func (x *FieldPathElement) ClearSubscript()
- func (x *FieldPathElement) ClearUintKey()
- func (x *FieldPathElement) ClearValueType()
- func (x *FieldPathElement) GetBoolKey() bool
- func (x *FieldPathElement) GetFieldName() string
- func (x *FieldPathElement) GetFieldNumber() int32
- func (x *FieldPathElement) GetFieldType() descriptorpb.FieldDescriptorProto_Type
- func (x *FieldPathElement) GetIndex() uint64
- func (x *FieldPathElement) GetIntKey() int64
- func (x *FieldPathElement) GetKeyType() descriptorpb.FieldDescriptorProto_Type
- func (x *FieldPathElement) GetStringKey() string
- func (x *FieldPathElement) GetSubscript() isFieldPathElement_Subscript
- func (x *FieldPathElement) GetUintKey() uint64
- func (x *FieldPathElement) GetValueType() descriptorpb.FieldDescriptorProto_Type
- func (x *FieldPathElement) HasBoolKey() bool
- func (x *FieldPathElement) HasFieldName() bool
- func (x *FieldPathElement) HasFieldNumber() bool
- func (x *FieldPathElement) HasFieldType() bool
- func (x *FieldPathElement) HasIndex() bool
- func (x *FieldPathElement) HasIntKey() bool
- func (x *FieldPathElement) HasKeyType() bool
- func (x *FieldPathElement) HasStringKey() bool
- func (x *FieldPathElement) HasSubscript() bool
- func (x *FieldPathElement) HasUintKey() bool
- func (x *FieldPathElement) HasValueType() bool
- func (*FieldPathElement) ProtoMessage()
- func (x *FieldPathElement) ProtoReflect() protoreflect.Message
- func (x *FieldPathElement) Reset()
- func (x *FieldPathElement) SetBoolKey(v bool)
- func (x *FieldPathElement) SetFieldName(v string)
- func (x *FieldPathElement) SetFieldNumber(v int32)
- func (x *FieldPathElement) SetFieldType(v descriptorpb.FieldDescriptorProto_Type)
- func (x *FieldPathElement) SetIndex(v uint64)
- func (x *FieldPathElement) SetIntKey(v int64)
- func (x *FieldPathElement) SetKeyType(v descriptorpb.FieldDescriptorProto_Type)
- func (x *FieldPathElement) SetStringKey(v string)
- func (x *FieldPathElement) SetUintKey(v uint64)
- func (x *FieldPathElement) SetValueType(v descriptorpb.FieldDescriptorProto_Type)
- func (x *FieldPathElement) String() string
- func (x *FieldPathElement) WhichSubscript() case_FieldPathElement_Subscript
- type FieldPathElement_BoolKey
- type FieldPathElement_Index
- type FieldPathElement_IntKey
- type FieldPathElement_StringKey
- type FieldPathElement_UintKey
- type FieldPathElement_builder
- type FieldPath_builder
- type FieldRules
- func (x *FieldRules) ClearAny()
- func (x *FieldRules) ClearBool()
- func (x *FieldRules) ClearBytes()
- func (x *FieldRules) ClearDouble()
- func (x *FieldRules) ClearDuration()
- func (x *FieldRules) ClearEnum()
- func (x *FieldRules) ClearFieldMask()
- func (x *FieldRules) ClearFixed32()
- func (x *FieldRules) ClearFixed64()
- func (x *FieldRules) ClearFloat()
- func (x *FieldRules) ClearIgnore()
- func (x *FieldRules) ClearInt32()
- func (x *FieldRules) ClearInt64()
- func (x *FieldRules) ClearMap()
- func (x *FieldRules) ClearRepeated()
- func (x *FieldRules) ClearRequired()
- func (x *FieldRules) ClearSfixed32()
- func (x *FieldRules) ClearSfixed64()
- func (x *FieldRules) ClearSint32()
- func (x *FieldRules) ClearSint64()
- func (x *FieldRules) ClearString()
- func (x *FieldRules) ClearTimestamp()
- func (x *FieldRules) ClearType()
- func (x *FieldRules) ClearUint32()
- func (x *FieldRules) ClearUint64()
- func (x *FieldRules) GetAny() *AnyRules
- func (x *FieldRules) GetBool() *BoolRules
- func (x *FieldRules) GetBytes() *BytesRules
- func (x *FieldRules) GetCel() []*Rule
- func (x *FieldRules) GetCelExpression() []string
- func (x *FieldRules) GetDouble() *DoubleRules
- func (x *FieldRules) GetDuration() *DurationRules
- func (x *FieldRules) GetEnum() *EnumRules
- func (x *FieldRules) GetFieldMask() *FieldMaskRules
- func (x *FieldRules) GetFixed32() *Fixed32Rules
- func (x *FieldRules) GetFixed64() *Fixed64Rules
- func (x *FieldRules) GetFloat() *FloatRules
- func (x *FieldRules) GetIgnore() Ignore
- func (x *FieldRules) GetInt32() *Int32Rules
- func (x *FieldRules) GetInt64() *Int64Rules
- func (x *FieldRules) GetMap() *MapRules
- func (x *FieldRules) GetRepeated() *RepeatedRules
- func (x *FieldRules) GetRequired() bool
- func (x *FieldRules) GetSfixed32() *SFixed32Rules
- func (x *FieldRules) GetSfixed64() *SFixed64Rules
- func (x *FieldRules) GetSint32() *SInt32Rules
- func (x *FieldRules) GetSint64() *SInt64Rules
- func (x *FieldRules) GetString() *StringRules
- func (x *FieldRules) GetString_() *StringRulesdeprecated
- func (x *FieldRules) GetTimestamp() *TimestampRules
- func (x *FieldRules) GetType() isFieldRules_Type
- func (x *FieldRules) GetUint32() *UInt32Rules
- func (x *FieldRules) GetUint64() *UInt64Rules
- func (x *FieldRules) HasAny() bool
- func (x *FieldRules) HasBool() bool
- func (x *FieldRules) HasBytes() bool
- func (x *FieldRules) HasDouble() bool
- func (x *FieldRules) HasDuration() bool
- func (x *FieldRules) HasEnum() bool
- func (x *FieldRules) HasFieldMask() bool
- func (x *FieldRules) HasFixed32() bool
- func (x *FieldRules) HasFixed64() bool
- func (x *FieldRules) HasFloat() bool
- func (x *FieldRules) HasIgnore() bool
- func (x *FieldRules) HasInt32() bool
- func (x *FieldRules) HasInt64() bool
- func (x *FieldRules) HasMap() bool
- func (x *FieldRules) HasRepeated() bool
- func (x *FieldRules) HasRequired() bool
- func (x *FieldRules) HasSfixed32() bool
- func (x *FieldRules) HasSfixed64() bool
- func (x *FieldRules) HasSint32() bool
- func (x *FieldRules) HasSint64() bool
- func (x *FieldRules) HasString() bool
- func (x *FieldRules) HasTimestamp() bool
- func (x *FieldRules) HasType() bool
- func (x *FieldRules) HasUint32() bool
- func (x *FieldRules) HasUint64() bool
- func (*FieldRules) ProtoMessage()
- func (x *FieldRules) ProtoReflect() protoreflect.Message
- func (x *FieldRules) Reset()
- func (x *FieldRules) SetAny(v *AnyRules)
- func (x *FieldRules) SetBool(v *BoolRules)
- func (x *FieldRules) SetBytes(v *BytesRules)
- func (x *FieldRules) SetCel(v []*Rule)
- func (x *FieldRules) SetCelExpression(v []string)
- func (x *FieldRules) SetDouble(v *DoubleRules)
- func (x *FieldRules) SetDuration(v *DurationRules)
- func (x *FieldRules) SetEnum(v *EnumRules)
- func (x *FieldRules) SetFieldMask(v *FieldMaskRules)
- func (x *FieldRules) SetFixed32(v *Fixed32Rules)
- func (x *FieldRules) SetFixed64(v *Fixed64Rules)
- func (x *FieldRules) SetFloat(v *FloatRules)
- func (x *FieldRules) SetIgnore(v Ignore)
- func (x *FieldRules) SetInt32(v *Int32Rules)
- func (x *FieldRules) SetInt64(v *Int64Rules)
- func (x *FieldRules) SetMap(v *MapRules)
- func (x *FieldRules) SetRepeated(v *RepeatedRules)
- func (x *FieldRules) SetRequired(v bool)
- func (x *FieldRules) SetSfixed32(v *SFixed32Rules)
- func (x *FieldRules) SetSfixed64(v *SFixed64Rules)
- func (x *FieldRules) SetSint32(v *SInt32Rules)
- func (x *FieldRules) SetSint64(v *SInt64Rules)
- func (x *FieldRules) SetString(v *StringRules)
- func (x *FieldRules) SetTimestamp(v *TimestampRules)
- func (x *FieldRules) SetUint32(v *UInt32Rules)
- func (x *FieldRules) SetUint64(v *UInt64Rules)
- func (x *FieldRules) String() string
- func (x *FieldRules) WhichType() case_FieldRules_Type
- type FieldRules_Any
- type FieldRules_Bool
- type FieldRules_Bytes
- type FieldRules_Double
- type FieldRules_Duration
- type FieldRules_Enum
- type FieldRules_FieldMask
- type FieldRules_Fixed32
- type FieldRules_Fixed64
- type FieldRules_Float
- type FieldRules_Int32
- type FieldRules_Int64
- type FieldRules_Map
- type FieldRules_Repeated
- type FieldRules_Sfixed32
- type FieldRules_Sfixed64
- type FieldRules_Sint32
- type FieldRules_Sint64
- type FieldRules_String_
- type FieldRules_Timestamp
- type FieldRules_Uint32
- type FieldRules_Uint64
- type FieldRules_builder
- type Fixed32Rules
- func (x *Fixed32Rules) ClearConst()
- func (x *Fixed32Rules) ClearGreaterThan()
- func (x *Fixed32Rules) ClearGt()
- func (x *Fixed32Rules) ClearGte()
- func (x *Fixed32Rules) ClearLessThan()
- func (x *Fixed32Rules) ClearLt()
- func (x *Fixed32Rules) ClearLte()
- func (x *Fixed32Rules) GetConst() uint32
- func (x *Fixed32Rules) GetExample() []uint32
- func (x *Fixed32Rules) GetGreaterThan() isFixed32Rules_GreaterThan
- func (x *Fixed32Rules) GetGt() uint32
- func (x *Fixed32Rules) GetGte() uint32
- func (x *Fixed32Rules) GetIn() []uint32
- func (x *Fixed32Rules) GetLessThan() isFixed32Rules_LessThan
- func (x *Fixed32Rules) GetLt() uint32
- func (x *Fixed32Rules) GetLte() uint32
- func (x *Fixed32Rules) GetNotIn() []uint32
- func (x *Fixed32Rules) HasConst() bool
- func (x *Fixed32Rules) HasGreaterThan() bool
- func (x *Fixed32Rules) HasGt() bool
- func (x *Fixed32Rules) HasGte() bool
- func (x *Fixed32Rules) HasLessThan() bool
- func (x *Fixed32Rules) HasLt() bool
- func (x *Fixed32Rules) HasLte() bool
- func (*Fixed32Rules) ProtoMessage()
- func (x *Fixed32Rules) ProtoReflect() protoreflect.Message
- func (x *Fixed32Rules) Reset()
- func (x *Fixed32Rules) SetConst(v uint32)
- func (x *Fixed32Rules) SetExample(v []uint32)
- func (x *Fixed32Rules) SetGt(v uint32)
- func (x *Fixed32Rules) SetGte(v uint32)
- func (x *Fixed32Rules) SetIn(v []uint32)
- func (x *Fixed32Rules) SetLt(v uint32)
- func (x *Fixed32Rules) SetLte(v uint32)
- func (x *Fixed32Rules) SetNotIn(v []uint32)
- func (x *Fixed32Rules) String() string
- func (x *Fixed32Rules) WhichGreaterThan() case_Fixed32Rules_GreaterThan
- func (x *Fixed32Rules) WhichLessThan() case_Fixed32Rules_LessThan
- type Fixed32Rules_Gt
- type Fixed32Rules_Gte
- type Fixed32Rules_Lt
- type Fixed32Rules_Lte
- type Fixed32Rules_builder
- type Fixed64Rules
- func (x *Fixed64Rules) ClearConst()
- func (x *Fixed64Rules) ClearGreaterThan()
- func (x *Fixed64Rules) ClearGt()
- func (x *Fixed64Rules) ClearGte()
- func (x *Fixed64Rules) ClearLessThan()
- func (x *Fixed64Rules) ClearLt()
- func (x *Fixed64Rules) ClearLte()
- func (x *Fixed64Rules) GetConst() uint64
- func (x *Fixed64Rules) GetExample() []uint64
- func (x *Fixed64Rules) GetGreaterThan() isFixed64Rules_GreaterThan
- func (x *Fixed64Rules) GetGt() uint64
- func (x *Fixed64Rules) GetGte() uint64
- func (x *Fixed64Rules) GetIn() []uint64
- func (x *Fixed64Rules) GetLessThan() isFixed64Rules_LessThan
- func (x *Fixed64Rules) GetLt() uint64
- func (x *Fixed64Rules) GetLte() uint64
- func (x *Fixed64Rules) GetNotIn() []uint64
- func (x *Fixed64Rules) HasConst() bool
- func (x *Fixed64Rules) HasGreaterThan() bool
- func (x *Fixed64Rules) HasGt() bool
- func (x *Fixed64Rules) HasGte() bool
- func (x *Fixed64Rules) HasLessThan() bool
- func (x *Fixed64Rules) HasLt() bool
- func (x *Fixed64Rules) HasLte() bool
- func (*Fixed64Rules) ProtoMessage()
- func (x *Fixed64Rules) ProtoReflect() protoreflect.Message
- func (x *Fixed64Rules) Reset()
- func (x *Fixed64Rules) SetConst(v uint64)
- func (x *Fixed64Rules) SetExample(v []uint64)
- func (x *Fixed64Rules) SetGt(v uint64)
- func (x *Fixed64Rules) SetGte(v uint64)
- func (x *Fixed64Rules) SetIn(v []uint64)
- func (x *Fixed64Rules) SetLt(v uint64)
- func (x *Fixed64Rules) SetLte(v uint64)
- func (x *Fixed64Rules) SetNotIn(v []uint64)
- func (x *Fixed64Rules) String() string
- func (x *Fixed64Rules) WhichGreaterThan() case_Fixed64Rules_GreaterThan
- func (x *Fixed64Rules) WhichLessThan() case_Fixed64Rules_LessThan
- type Fixed64Rules_Gt
- type Fixed64Rules_Gte
- type Fixed64Rules_Lt
- type Fixed64Rules_Lte
- type Fixed64Rules_builder
- type FloatRules
- func (x *FloatRules) ClearConst()
- func (x *FloatRules) ClearFinite()
- func (x *FloatRules) ClearGreaterThan()
- func (x *FloatRules) ClearGt()
- func (x *FloatRules) ClearGte()
- func (x *FloatRules) ClearLessThan()
- func (x *FloatRules) ClearLt()
- func (x *FloatRules) ClearLte()
- func (x *FloatRules) GetConst() float32
- func (x *FloatRules) GetExample() []float32
- func (x *FloatRules) GetFinite() bool
- func (x *FloatRules) GetGreaterThan() isFloatRules_GreaterThan
- func (x *FloatRules) GetGt() float32
- func (x *FloatRules) GetGte() float32
- func (x *FloatRules) GetIn() []float32
- func (x *FloatRules) GetLessThan() isFloatRules_LessThan
- func (x *FloatRules) GetLt() float32
- func (x *FloatRules) GetLte() float32
- func (x *FloatRules) GetNotIn() []float32
- func (x *FloatRules) HasConst() bool
- func (x *FloatRules) HasFinite() bool
- func (x *FloatRules) HasGreaterThan() bool
- func (x *FloatRules) HasGt() bool
- func (x *FloatRules) HasGte() bool
- func (x *FloatRules) HasLessThan() bool
- func (x *FloatRules) HasLt() bool
- func (x *FloatRules) HasLte() bool
- func (*FloatRules) ProtoMessage()
- func (x *FloatRules) ProtoReflect() protoreflect.Message
- func (x *FloatRules) Reset()
- func (x *FloatRules) SetConst(v float32)
- func (x *FloatRules) SetExample(v []float32)
- func (x *FloatRules) SetFinite(v bool)
- func (x *FloatRules) SetGt(v float32)
- func (x *FloatRules) SetGte(v float32)
- func (x *FloatRules) SetIn(v []float32)
- func (x *FloatRules) SetLt(v float32)
- func (x *FloatRules) SetLte(v float32)
- func (x *FloatRules) SetNotIn(v []float32)
- func (x *FloatRules) String() string
- func (x *FloatRules) WhichGreaterThan() case_FloatRules_GreaterThan
- func (x *FloatRules) WhichLessThan() case_FloatRules_LessThan
- type FloatRules_Gt
- type FloatRules_Gte
- type FloatRules_Lt
- type FloatRules_Lte
- type FloatRules_builder
- type Ignore
- type Int32Rules
- func (x *Int32Rules) ClearConst()
- func (x *Int32Rules) ClearGreaterThan()
- func (x *Int32Rules) ClearGt()
- func (x *Int32Rules) ClearGte()
- func (x *Int32Rules) ClearLessThan()
- func (x *Int32Rules) ClearLt()
- func (x *Int32Rules) ClearLte()
- func (x *Int32Rules) GetConst() int32
- func (x *Int32Rules) GetExample() []int32
- func (x *Int32Rules) GetGreaterThan() isInt32Rules_GreaterThan
- func (x *Int32Rules) GetGt() int32
- func (x *Int32Rules) GetGte() int32
- func (x *Int32Rules) GetIn() []int32
- func (x *Int32Rules) GetLessThan() isInt32Rules_LessThan
- func (x *Int32Rules) GetLt() int32
- func (x *Int32Rules) GetLte() int32
- func (x *Int32Rules) GetNotIn() []int32
- func (x *Int32Rules) HasConst() bool
- func (x *Int32Rules) HasGreaterThan() bool
- func (x *Int32Rules) HasGt() bool
- func (x *Int32Rules) HasGte() bool
- func (x *Int32Rules) HasLessThan() bool
- func (x *Int32Rules) HasLt() bool
- func (x *Int32Rules) HasLte() bool
- func (*Int32Rules) ProtoMessage()
- func (x *Int32Rules) ProtoReflect() protoreflect.Message
- func (x *Int32Rules) Reset()
- func (x *Int32Rules) SetConst(v int32)
- func (x *Int32Rules) SetExample(v []int32)
- func (x *Int32Rules) SetGt(v int32)
- func (x *Int32Rules) SetGte(v int32)
- func (x *Int32Rules) SetIn(v []int32)
- func (x *Int32Rules) SetLt(v int32)
- func (x *Int32Rules) SetLte(v int32)
- func (x *Int32Rules) SetNotIn(v []int32)
- func (x *Int32Rules) String() string
- func (x *Int32Rules) WhichGreaterThan() case_Int32Rules_GreaterThan
- func (x *Int32Rules) WhichLessThan() case_Int32Rules_LessThan
- type Int32Rules_Gt
- type Int32Rules_Gte
- type Int32Rules_Lt
- type Int32Rules_Lte
- type Int32Rules_builder
- type Int64Rules
- func (x *Int64Rules) ClearConst()
- func (x *Int64Rules) ClearGreaterThan()
- func (x *Int64Rules) ClearGt()
- func (x *Int64Rules) ClearGte()
- func (x *Int64Rules) ClearLessThan()
- func (x *Int64Rules) ClearLt()
- func (x *Int64Rules) ClearLte()
- func (x *Int64Rules) GetConst() int64
- func (x *Int64Rules) GetExample() []int64
- func (x *Int64Rules) GetGreaterThan() isInt64Rules_GreaterThan
- func (x *Int64Rules) GetGt() int64
- func (x *Int64Rules) GetGte() int64
- func (x *Int64Rules) GetIn() []int64
- func (x *Int64Rules) GetLessThan() isInt64Rules_LessThan
- func (x *Int64Rules) GetLt() int64
- func (x *Int64Rules) GetLte() int64
- func (x *Int64Rules) GetNotIn() []int64
- func (x *Int64Rules) HasConst() bool
- func (x *Int64Rules) HasGreaterThan() bool
- func (x *Int64Rules) HasGt() bool
- func (x *Int64Rules) HasGte() bool
- func (x *Int64Rules) HasLessThan() bool
- func (x *Int64Rules) HasLt() bool
- func (x *Int64Rules) HasLte() bool
- func (*Int64Rules) ProtoMessage()
- func (x *Int64Rules) ProtoReflect() protoreflect.Message
- func (x *Int64Rules) Reset()
- func (x *Int64Rules) SetConst(v int64)
- func (x *Int64Rules) SetExample(v []int64)
- func (x *Int64Rules) SetGt(v int64)
- func (x *Int64Rules) SetGte(v int64)
- func (x *Int64Rules) SetIn(v []int64)
- func (x *Int64Rules) SetLt(v int64)
- func (x *Int64Rules) SetLte(v int64)
- func (x *Int64Rules) SetNotIn(v []int64)
- func (x *Int64Rules) String() string
- func (x *Int64Rules) WhichGreaterThan() case_Int64Rules_GreaterThan
- func (x *Int64Rules) WhichLessThan() case_Int64Rules_LessThan
- type Int64Rules_Gt
- type Int64Rules_Gte
- type Int64Rules_Lt
- type Int64Rules_Lte
- type Int64Rules_builder
- type KnownRegex
- type MapRules
- func (x *MapRules) ClearKeys()
- func (x *MapRules) ClearMaxPairs()
- func (x *MapRules) ClearMinPairs()
- func (x *MapRules) ClearValues()
- func (x *MapRules) GetKeys() *FieldRules
- func (x *MapRules) GetMaxPairs() uint64
- func (x *MapRules) GetMinPairs() uint64
- func (x *MapRules) GetValues() *FieldRules
- func (x *MapRules) HasKeys() bool
- func (x *MapRules) HasMaxPairs() bool
- func (x *MapRules) HasMinPairs() bool
- func (x *MapRules) HasValues() bool
- func (*MapRules) ProtoMessage()
- func (x *MapRules) ProtoReflect() protoreflect.Message
- func (x *MapRules) Reset()
- func (x *MapRules) SetKeys(v *FieldRules)
- func (x *MapRules) SetMaxPairs(v uint64)
- func (x *MapRules) SetMinPairs(v uint64)
- func (x *MapRules) SetValues(v *FieldRules)
- func (x *MapRules) String() string
- type MapRules_builder
- type MessageOneofRule
- func (x *MessageOneofRule) ClearRequired()
- func (x *MessageOneofRule) GetFields() []string
- func (x *MessageOneofRule) GetRequired() bool
- func (x *MessageOneofRule) HasRequired() bool
- func (*MessageOneofRule) ProtoMessage()
- func (x *MessageOneofRule) ProtoReflect() protoreflect.Message
- func (x *MessageOneofRule) Reset()
- func (x *MessageOneofRule) SetFields(v []string)
- func (x *MessageOneofRule) SetRequired(v bool)
- func (x *MessageOneofRule) String() string
- type MessageOneofRule_builder
- type MessageRules
- func (x *MessageRules) GetCel() []*Rule
- func (x *MessageRules) GetCelExpression() []string
- func (x *MessageRules) GetOneof() []*MessageOneofRule
- func (*MessageRules) ProtoMessage()
- func (x *MessageRules) ProtoReflect() protoreflect.Message
- func (x *MessageRules) Reset()
- func (x *MessageRules) SetCel(v []*Rule)
- func (x *MessageRules) SetCelExpression(v []string)
- func (x *MessageRules) SetOneof(v []*MessageOneofRule)
- func (x *MessageRules) String() string
- type MessageRules_builder
- type OneofRules
- func (x *OneofRules) ClearRequired()
- func (x *OneofRules) GetRequired() bool
- func (x *OneofRules) HasRequired() bool
- func (*OneofRules) ProtoMessage()
- func (x *OneofRules) ProtoReflect() protoreflect.Message
- func (x *OneofRules) Reset()
- func (x *OneofRules) SetRequired(v bool)
- func (x *OneofRules) String() string
- type OneofRules_builder
- type PredefinedRules
- type PredefinedRules_builder
- type RepeatedRules
- func (x *RepeatedRules) ClearItems()
- func (x *RepeatedRules) ClearMaxItems()
- func (x *RepeatedRules) ClearMinItems()
- func (x *RepeatedRules) ClearUnique()
- func (x *RepeatedRules) GetItems() *FieldRules
- func (x *RepeatedRules) GetMaxItems() uint64
- func (x *RepeatedRules) GetMinItems() uint64
- func (x *RepeatedRules) GetUnique() bool
- func (x *RepeatedRules) HasItems() bool
- func (x *RepeatedRules) HasMaxItems() bool
- func (x *RepeatedRules) HasMinItems() bool
- func (x *RepeatedRules) HasUnique() bool
- func (*RepeatedRules) ProtoMessage()
- func (x *RepeatedRules) ProtoReflect() protoreflect.Message
- func (x *RepeatedRules) Reset()
- func (x *RepeatedRules) SetItems(v *FieldRules)
- func (x *RepeatedRules) SetMaxItems(v uint64)
- func (x *RepeatedRules) SetMinItems(v uint64)
- func (x *RepeatedRules) SetUnique(v bool)
- func (x *RepeatedRules) String() string
- type RepeatedRules_builder
- type Rule
- func (x *Rule) ClearExpression()
- func (x *Rule) ClearId()
- func (x *Rule) ClearMessage()
- func (x *Rule) GetExpression() string
- func (x *Rule) GetId() string
- func (x *Rule) GetMessage() string
- func (x *Rule) HasExpression() bool
- func (x *Rule) HasId() bool
- func (x *Rule) HasMessage() bool
- func (*Rule) ProtoMessage()
- func (x *Rule) ProtoReflect() protoreflect.Message
- func (x *Rule) Reset()
- func (x *Rule) SetExpression(v string)
- func (x *Rule) SetId(v string)
- func (x *Rule) SetMessage(v string)
- func (x *Rule) String() string
- type Rule_builder
- type SFixed32Rules
- func (x *SFixed32Rules) ClearConst()
- func (x *SFixed32Rules) ClearGreaterThan()
- func (x *SFixed32Rules) ClearGt()
- func (x *SFixed32Rules) ClearGte()
- func (x *SFixed32Rules) ClearLessThan()
- func (x *SFixed32Rules) ClearLt()
- func (x *SFixed32Rules) ClearLte()
- func (x *SFixed32Rules) GetConst() int32
- func (x *SFixed32Rules) GetExample() []int32
- func (x *SFixed32Rules) GetGreaterThan() isSFixed32Rules_GreaterThan
- func (x *SFixed32Rules) GetGt() int32
- func (x *SFixed32Rules) GetGte() int32
- func (x *SFixed32Rules) GetIn() []int32
- func (x *SFixed32Rules) GetLessThan() isSFixed32Rules_LessThan
- func (x *SFixed32Rules) GetLt() int32
- func (x *SFixed32Rules) GetLte() int32
- func (x *SFixed32Rules) GetNotIn() []int32
- func (x *SFixed32Rules) HasConst() bool
- func (x *SFixed32Rules) HasGreaterThan() bool
- func (x *SFixed32Rules) HasGt() bool
- func (x *SFixed32Rules) HasGte() bool
- func (x *SFixed32Rules) HasLessThan() bool
- func (x *SFixed32Rules) HasLt() bool
- func (x *SFixed32Rules) HasLte() bool
- func (*SFixed32Rules) ProtoMessage()
- func (x *SFixed32Rules) ProtoReflect() protoreflect.Message
- func (x *SFixed32Rules) Reset()
- func (x *SFixed32Rules) SetConst(v int32)
- func (x *SFixed32Rules) SetExample(v []int32)
- func (x *SFixed32Rules) SetGt(v int32)
- func (x *SFixed32Rules) SetGte(v int32)
- func (x *SFixed32Rules) SetIn(v []int32)
- func (x *SFixed32Rules) SetLt(v int32)
- func (x *SFixed32Rules) SetLte(v int32)
- func (x *SFixed32Rules) SetNotIn(v []int32)
- func (x *SFixed32Rules) String() string
- func (x *SFixed32Rules) WhichGreaterThan() case_SFixed32Rules_GreaterThan
- func (x *SFixed32Rules) WhichLessThan() case_SFixed32Rules_LessThan
- type SFixed32Rules_Gt
- type SFixed32Rules_Gte
- type SFixed32Rules_Lt
- type SFixed32Rules_Lte
- type SFixed32Rules_builder
- type SFixed64Rules
- func (x *SFixed64Rules) ClearConst()
- func (x *SFixed64Rules) ClearGreaterThan()
- func (x *SFixed64Rules) ClearGt()
- func (x *SFixed64Rules) ClearGte()
- func (x *SFixed64Rules) ClearLessThan()
- func (x *SFixed64Rules) ClearLt()
- func (x *SFixed64Rules) ClearLte()
- func (x *SFixed64Rules) GetConst() int64
- func (x *SFixed64Rules) GetExample() []int64
- func (x *SFixed64Rules) GetGreaterThan() isSFixed64Rules_GreaterThan
- func (x *SFixed64Rules) GetGt() int64
- func (x *SFixed64Rules) GetGte() int64
- func (x *SFixed64Rules) GetIn() []int64
- func (x *SFixed64Rules) GetLessThan() isSFixed64Rules_LessThan
- func (x *SFixed64Rules) GetLt() int64
- func (x *SFixed64Rules) GetLte() int64
- func (x *SFixed64Rules) GetNotIn() []int64
- func (x *SFixed64Rules) HasConst() bool
- func (x *SFixed64Rules) HasGreaterThan() bool
- func (x *SFixed64Rules) HasGt() bool
- func (x *SFixed64Rules) HasGte() bool
- func (x *SFixed64Rules) HasLessThan() bool
- func (x *SFixed64Rules) HasLt() bool
- func (x *SFixed64Rules) HasLte() bool
- func (*SFixed64Rules) ProtoMessage()
- func (x *SFixed64Rules) ProtoReflect() protoreflect.Message
- func (x *SFixed64Rules) Reset()
- func (x *SFixed64Rules) SetConst(v int64)
- func (x *SFixed64Rules) SetExample(v []int64)
- func (x *SFixed64Rules) SetGt(v int64)
- func (x *SFixed64Rules) SetGte(v int64)
- func (x *SFixed64Rules) SetIn(v []int64)
- func (x *SFixed64Rules) SetLt(v int64)
- func (x *SFixed64Rules) SetLte(v int64)
- func (x *SFixed64Rules) SetNotIn(v []int64)
- func (x *SFixed64Rules) String() string
- func (x *SFixed64Rules) WhichGreaterThan() case_SFixed64Rules_GreaterThan
- func (x *SFixed64Rules) WhichLessThan() case_SFixed64Rules_LessThan
- type SFixed64Rules_Gt
- type SFixed64Rules_Gte
- type SFixed64Rules_Lt
- type SFixed64Rules_Lte
- type SFixed64Rules_builder
- type SInt32Rules
- func (x *SInt32Rules) ClearConst()
- func (x *SInt32Rules) ClearGreaterThan()
- func (x *SInt32Rules) ClearGt()
- func (x *SInt32Rules) ClearGte()
- func (x *SInt32Rules) ClearLessThan()
- func (x *SInt32Rules) ClearLt()
- func (x *SInt32Rules) ClearLte()
- func (x *SInt32Rules) GetConst() int32
- func (x *SInt32Rules) GetExample() []int32
- func (x *SInt32Rules) GetGreaterThan() isSInt32Rules_GreaterThan
- func (x *SInt32Rules) GetGt() int32
- func (x *SInt32Rules) GetGte() int32
- func (x *SInt32Rules) GetIn() []int32
- func (x *SInt32Rules) GetLessThan() isSInt32Rules_LessThan
- func (x *SInt32Rules) GetLt() int32
- func (x *SInt32Rules) GetLte() int32
- func (x *SInt32Rules) GetNotIn() []int32
- func (x *SInt32Rules) HasConst() bool
- func (x *SInt32Rules) HasGreaterThan() bool
- func (x *SInt32Rules) HasGt() bool
- func (x *SInt32Rules) HasGte() bool
- func (x *SInt32Rules) HasLessThan() bool
- func (x *SInt32Rules) HasLt() bool
- func (x *SInt32Rules) HasLte() bool
- func (*SInt32Rules) ProtoMessage()
- func (x *SInt32Rules) ProtoReflect() protoreflect.Message
- func (x *SInt32Rules) Reset()
- func (x *SInt32Rules) SetConst(v int32)
- func (x *SInt32Rules) SetExample(v []int32)
- func (x *SInt32Rules) SetGt(v int32)
- func (x *SInt32Rules) SetGte(v int32)
- func (x *SInt32Rules) SetIn(v []int32)
- func (x *SInt32Rules) SetLt(v int32)
- func (x *SInt32Rules) SetLte(v int32)
- func (x *SInt32Rules) SetNotIn(v []int32)
- func (x *SInt32Rules) String() string
- func (x *SInt32Rules) WhichGreaterThan() case_SInt32Rules_GreaterThan
- func (x *SInt32Rules) WhichLessThan() case_SInt32Rules_LessThan
- type SInt32Rules_Gt
- type SInt32Rules_Gte
- type SInt32Rules_Lt
- type SInt32Rules_Lte
- type SInt32Rules_builder
- type SInt64Rules
- func (x *SInt64Rules) ClearConst()
- func (x *SInt64Rules) ClearGreaterThan()
- func (x *SInt64Rules) ClearGt()
- func (x *SInt64Rules) ClearGte()
- func (x *SInt64Rules) ClearLessThan()
- func (x *SInt64Rules) ClearLt()
- func (x *SInt64Rules) ClearLte()
- func (x *SInt64Rules) GetConst() int64
- func (x *SInt64Rules) GetExample() []int64
- func (x *SInt64Rules) GetGreaterThan() isSInt64Rules_GreaterThan
- func (x *SInt64Rules) GetGt() int64
- func (x *SInt64Rules) GetGte() int64
- func (x *SInt64Rules) GetIn() []int64
- func (x *SInt64Rules) GetLessThan() isSInt64Rules_LessThan
- func (x *SInt64Rules) GetLt() int64
- func (x *SInt64Rules) GetLte() int64
- func (x *SInt64Rules) GetNotIn() []int64
- func (x *SInt64Rules) HasConst() bool
- func (x *SInt64Rules) HasGreaterThan() bool
- func (x *SInt64Rules) HasGt() bool
- func (x *SInt64Rules) HasGte() bool
- func (x *SInt64Rules) HasLessThan() bool
- func (x *SInt64Rules) HasLt() bool
- func (x *SInt64Rules) HasLte() bool
- func (*SInt64Rules) ProtoMessage()
- func (x *SInt64Rules) ProtoReflect() protoreflect.Message
- func (x *SInt64Rules) Reset()
- func (x *SInt64Rules) SetConst(v int64)
- func (x *SInt64Rules) SetExample(v []int64)
- func (x *SInt64Rules) SetGt(v int64)
- func (x *SInt64Rules) SetGte(v int64)
- func (x *SInt64Rules) SetIn(v []int64)
- func (x *SInt64Rules) SetLt(v int64)
- func (x *SInt64Rules) SetLte(v int64)
- func (x *SInt64Rules) SetNotIn(v []int64)
- func (x *SInt64Rules) String() string
- func (x *SInt64Rules) WhichGreaterThan() case_SInt64Rules_GreaterThan
- func (x *SInt64Rules) WhichLessThan() case_SInt64Rules_LessThan
- type SInt64Rules_Gt
- type SInt64Rules_Gte
- type SInt64Rules_Lt
- type SInt64Rules_Lte
- type SInt64Rules_builder
- type StringRules
- func (x *StringRules) ClearAddress()
- func (x *StringRules) ClearConst()
- func (x *StringRules) ClearContains()
- func (x *StringRules) ClearEmail()
- func (x *StringRules) ClearHostAndPort()
- func (x *StringRules) ClearHostname()
- func (x *StringRules) ClearIp()
- func (x *StringRules) ClearIpPrefix()
- func (x *StringRules) ClearIpWithPrefixlen()
- func (x *StringRules) ClearIpv4()
- func (x *StringRules) ClearIpv4Prefix()
- func (x *StringRules) ClearIpv4WithPrefixlen()
- func (x *StringRules) ClearIpv6()
- func (x *StringRules) ClearIpv6Prefix()
- func (x *StringRules) ClearIpv6WithPrefixlen()
- func (x *StringRules) ClearLen()
- func (x *StringRules) ClearLenBytes()
- func (x *StringRules) ClearMaxBytes()
- func (x *StringRules) ClearMaxLen()
- func (x *StringRules) ClearMinBytes()
- func (x *StringRules) ClearMinLen()
- func (x *StringRules) ClearNotContains()
- func (x *StringRules) ClearPattern()
- func (x *StringRules) ClearPrefix()
- func (x *StringRules) ClearProtobufDotFqn()
- func (x *StringRules) ClearProtobufFqn()
- func (x *StringRules) ClearStrict()
- func (x *StringRules) ClearSuffix()
- func (x *StringRules) ClearTuuid()
- func (x *StringRules) ClearUlid()
- func (x *StringRules) ClearUri()
- func (x *StringRules) ClearUriRef()
- func (x *StringRules) ClearUuid()
- func (x *StringRules) ClearWellKnown()
- func (x *StringRules) ClearWellKnownRegex()
- func (x *StringRules) GetAddress() bool
- func (x *StringRules) GetConst() string
- func (x *StringRules) GetContains() string
- func (x *StringRules) GetEmail() bool
- func (x *StringRules) GetExample() []string
- func (x *StringRules) GetHostAndPort() bool
- func (x *StringRules) GetHostname() bool
- func (x *StringRules) GetIn() []string
- func (x *StringRules) GetIp() bool
- func (x *StringRules) GetIpPrefix() bool
- func (x *StringRules) GetIpWithPrefixlen() bool
- func (x *StringRules) GetIpv4() bool
- func (x *StringRules) GetIpv4Prefix() bool
- func (x *StringRules) GetIpv4WithPrefixlen() bool
- func (x *StringRules) GetIpv6() bool
- func (x *StringRules) GetIpv6Prefix() bool
- func (x *StringRules) GetIpv6WithPrefixlen() bool
- func (x *StringRules) GetLen() uint64
- func (x *StringRules) GetLenBytes() uint64
- func (x *StringRules) GetMaxBytes() uint64
- func (x *StringRules) GetMaxLen() uint64
- func (x *StringRules) GetMinBytes() uint64
- func (x *StringRules) GetMinLen() uint64
- func (x *StringRules) GetNotContains() string
- func (x *StringRules) GetNotIn() []string
- func (x *StringRules) GetPattern() string
- func (x *StringRules) GetPrefix() string
- func (x *StringRules) GetProtobufDotFqn() bool
- func (x *StringRules) GetProtobufFqn() bool
- func (x *StringRules) GetStrict() bool
- func (x *StringRules) GetSuffix() string
- func (x *StringRules) GetTuuid() bool
- func (x *StringRules) GetUlid() bool
- func (x *StringRules) GetUri() bool
- func (x *StringRules) GetUriRef() bool
- func (x *StringRules) GetUuid() bool
- func (x *StringRules) GetWellKnown() isStringRules_WellKnown
- func (x *StringRules) GetWellKnownRegex() KnownRegex
- func (x *StringRules) HasAddress() bool
- func (x *StringRules) HasConst() bool
- func (x *StringRules) HasContains() bool
- func (x *StringRules) HasEmail() bool
- func (x *StringRules) HasHostAndPort() bool
- func (x *StringRules) HasHostname() bool
- func (x *StringRules) HasIp() bool
- func (x *StringRules) HasIpPrefix() bool
- func (x *StringRules) HasIpWithPrefixlen() bool
- func (x *StringRules) HasIpv4() bool
- func (x *StringRules) HasIpv4Prefix() bool
- func (x *StringRules) HasIpv4WithPrefixlen() bool
- func (x *StringRules) HasIpv6() bool
- func (x *StringRules) HasIpv6Prefix() bool
- func (x *StringRules) HasIpv6WithPrefixlen() bool
- func (x *StringRules) HasLen() bool
- func (x *StringRules) HasLenBytes() bool
- func (x *StringRules) HasMaxBytes() bool
- func (x *StringRules) HasMaxLen() bool
- func (x *StringRules) HasMinBytes() bool
- func (x *StringRules) HasMinLen() bool
- func (x *StringRules) HasNotContains() bool
- func (x *StringRules) HasPattern() bool
- func (x *StringRules) HasPrefix() bool
- func (x *StringRules) HasProtobufDotFqn() bool
- func (x *StringRules) HasProtobufFqn() bool
- func (x *StringRules) HasStrict() bool
- func (x *StringRules) HasSuffix() bool
- func (x *StringRules) HasTuuid() bool
- func (x *StringRules) HasUlid() bool
- func (x *StringRules) HasUri() bool
- func (x *StringRules) HasUriRef() bool
- func (x *StringRules) HasUuid() bool
- func (x *StringRules) HasWellKnown() bool
- func (x *StringRules) HasWellKnownRegex() bool
- func (*StringRules) ProtoMessage()
- func (x *StringRules) ProtoReflect() protoreflect.Message
- func (x *StringRules) Reset()
- func (x *StringRules) SetAddress(v bool)
- func (x *StringRules) SetConst(v string)
- func (x *StringRules) SetContains(v string)
- func (x *StringRules) SetEmail(v bool)
- func (x *StringRules) SetExample(v []string)
- func (x *StringRules) SetHostAndPort(v bool)
- func (x *StringRules) SetHostname(v bool)
- func (x *StringRules) SetIn(v []string)
- func (x *StringRules) SetIp(v bool)
- func (x *StringRules) SetIpPrefix(v bool)
- func (x *StringRules) SetIpWithPrefixlen(v bool)
- func (x *StringRules) SetIpv4(v bool)
- func (x *StringRules) SetIpv4Prefix(v bool)
- func (x *StringRules) SetIpv4WithPrefixlen(v bool)
- func (x *StringRules) SetIpv6(v bool)
- func (x *StringRules) SetIpv6Prefix(v bool)
- func (x *StringRules) SetIpv6WithPrefixlen(v bool)
- func (x *StringRules) SetLen(v uint64)
- func (x *StringRules) SetLenBytes(v uint64)
- func (x *StringRules) SetMaxBytes(v uint64)
- func (x *StringRules) SetMaxLen(v uint64)
- func (x *StringRules) SetMinBytes(v uint64)
- func (x *StringRules) SetMinLen(v uint64)
- func (x *StringRules) SetNotContains(v string)
- func (x *StringRules) SetNotIn(v []string)
- func (x *StringRules) SetPattern(v string)
- func (x *StringRules) SetPrefix(v string)
- func (x *StringRules) SetProtobufDotFqn(v bool)
- func (x *StringRules) SetProtobufFqn(v bool)
- func (x *StringRules) SetStrict(v bool)
- func (x *StringRules) SetSuffix(v string)
- func (x *StringRules) SetTuuid(v bool)
- func (x *StringRules) SetUlid(v bool)
- func (x *StringRules) SetUri(v bool)
- func (x *StringRules) SetUriRef(v bool)
- func (x *StringRules) SetUuid(v bool)
- func (x *StringRules) SetWellKnownRegex(v KnownRegex)
- func (x *StringRules) String() string
- func (x *StringRules) WhichWellKnown() case_StringRules_WellKnown
- type StringRules_Address
- type StringRules_Email
- type StringRules_HostAndPort
- type StringRules_Hostname
- type StringRules_Ip
- type StringRules_IpPrefix
- type StringRules_IpWithPrefixlen
- type StringRules_Ipv4
- type StringRules_Ipv4Prefix
- type StringRules_Ipv4WithPrefixlen
- type StringRules_Ipv6
- type StringRules_Ipv6Prefix
- type StringRules_Ipv6WithPrefixlen
- type StringRules_ProtobufDotFqn
- type StringRules_ProtobufFqn
- type StringRules_Tuuid
- type StringRules_Ulid
- type StringRules_Uri
- type StringRules_UriRef
- type StringRules_Uuid
- type StringRules_WellKnownRegex
- type StringRules_builder
- type TimestampRules
- func (x *TimestampRules) ClearConst()
- func (x *TimestampRules) ClearGreaterThan()
- func (x *TimestampRules) ClearGt()
- func (x *TimestampRules) ClearGtNow()
- func (x *TimestampRules) ClearGte()
- func (x *TimestampRules) ClearLessThan()
- func (x *TimestampRules) ClearLt()
- func (x *TimestampRules) ClearLtNow()
- func (x *TimestampRules) ClearLte()
- func (x *TimestampRules) ClearWithin()
- func (x *TimestampRules) GetConst() *timestamppb.Timestamp
- func (x *TimestampRules) GetExample() []*timestamppb.Timestamp
- func (x *TimestampRules) GetGreaterThan() isTimestampRules_GreaterThan
- func (x *TimestampRules) GetGt() *timestamppb.Timestamp
- func (x *TimestampRules) GetGtNow() bool
- func (x *TimestampRules) GetGte() *timestamppb.Timestamp
- func (x *TimestampRules) GetLessThan() isTimestampRules_LessThan
- func (x *TimestampRules) GetLt() *timestamppb.Timestamp
- func (x *TimestampRules) GetLtNow() bool
- func (x *TimestampRules) GetLte() *timestamppb.Timestamp
- func (x *TimestampRules) GetWithin() *durationpb.Duration
- func (x *TimestampRules) HasConst() bool
- func (x *TimestampRules) HasGreaterThan() bool
- func (x *TimestampRules) HasGt() bool
- func (x *TimestampRules) HasGtNow() bool
- func (x *TimestampRules) HasGte() bool
- func (x *TimestampRules) HasLessThan() bool
- func (x *TimestampRules) HasLt() bool
- func (x *TimestampRules) HasLtNow() bool
- func (x *TimestampRules) HasLte() bool
- func (x *TimestampRules) HasWithin() bool
- func (*TimestampRules) ProtoMessage()
- func (x *TimestampRules) ProtoReflect() protoreflect.Message
- func (x *TimestampRules) Reset()
- func (x *TimestampRules) SetConst(v *timestamppb.Timestamp)
- func (x *TimestampRules) SetExample(v []*timestamppb.Timestamp)
- func (x *TimestampRules) SetGt(v *timestamppb.Timestamp)
- func (x *TimestampRules) SetGtNow(v bool)
- func (x *TimestampRules) SetGte(v *timestamppb.Timestamp)
- func (x *TimestampRules) SetLt(v *timestamppb.Timestamp)
- func (x *TimestampRules) SetLtNow(v bool)
- func (x *TimestampRules) SetLte(v *timestamppb.Timestamp)
- func (x *TimestampRules) SetWithin(v *durationpb.Duration)
- func (x *TimestampRules) String() string
- func (x *TimestampRules) WhichGreaterThan() case_TimestampRules_GreaterThan
- func (x *TimestampRules) WhichLessThan() case_TimestampRules_LessThan
- type TimestampRules_Gt
- type TimestampRules_GtNow
- type TimestampRules_Gte
- type TimestampRules_Lt
- type TimestampRules_LtNow
- type TimestampRules_Lte
- type TimestampRules_builder
- type UInt32Rules
- func (x *UInt32Rules) ClearConst()
- func (x *UInt32Rules) ClearGreaterThan()
- func (x *UInt32Rules) ClearGt()
- func (x *UInt32Rules) ClearGte()
- func (x *UInt32Rules) ClearLessThan()
- func (x *UInt32Rules) ClearLt()
- func (x *UInt32Rules) ClearLte()
- func (x *UInt32Rules) GetConst() uint32
- func (x *UInt32Rules) GetExample() []uint32
- func (x *UInt32Rules) GetGreaterThan() isUInt32Rules_GreaterThan
- func (x *UInt32Rules) GetGt() uint32
- func (x *UInt32Rules) GetGte() uint32
- func (x *UInt32Rules) GetIn() []uint32
- func (x *UInt32Rules) GetLessThan() isUInt32Rules_LessThan
- func (x *UInt32Rules) GetLt() uint32
- func (x *UInt32Rules) GetLte() uint32
- func (x *UInt32Rules) GetNotIn() []uint32
- func (x *UInt32Rules) HasConst() bool
- func (x *UInt32Rules) HasGreaterThan() bool
- func (x *UInt32Rules) HasGt() bool
- func (x *UInt32Rules) HasGte() bool
- func (x *UInt32Rules) HasLessThan() bool
- func (x *UInt32Rules) HasLt() bool
- func (x *UInt32Rules) HasLte() bool
- func (*UInt32Rules) ProtoMessage()
- func (x *UInt32Rules) ProtoReflect() protoreflect.Message
- func (x *UInt32Rules) Reset()
- func (x *UInt32Rules) SetConst(v uint32)
- func (x *UInt32Rules) SetExample(v []uint32)
- func (x *UInt32Rules) SetGt(v uint32)
- func (x *UInt32Rules) SetGte(v uint32)
- func (x *UInt32Rules) SetIn(v []uint32)
- func (x *UInt32Rules) SetLt(v uint32)
- func (x *UInt32Rules) SetLte(v uint32)
- func (x *UInt32Rules) SetNotIn(v []uint32)
- func (x *UInt32Rules) String() string
- func (x *UInt32Rules) WhichGreaterThan() case_UInt32Rules_GreaterThan
- func (x *UInt32Rules) WhichLessThan() case_UInt32Rules_LessThan
- type UInt32Rules_Gt
- type UInt32Rules_Gte
- type UInt32Rules_Lt
- type UInt32Rules_Lte
- type UInt32Rules_builder
- type UInt64Rules
- func (x *UInt64Rules) ClearConst()
- func (x *UInt64Rules) ClearGreaterThan()
- func (x *UInt64Rules) ClearGt()
- func (x *UInt64Rules) ClearGte()
- func (x *UInt64Rules) ClearLessThan()
- func (x *UInt64Rules) ClearLt()
- func (x *UInt64Rules) ClearLte()
- func (x *UInt64Rules) GetConst() uint64
- func (x *UInt64Rules) GetExample() []uint64
- func (x *UInt64Rules) GetGreaterThan() isUInt64Rules_GreaterThan
- func (x *UInt64Rules) GetGt() uint64
- func (x *UInt64Rules) GetGte() uint64
- func (x *UInt64Rules) GetIn() []uint64
- func (x *UInt64Rules) GetLessThan() isUInt64Rules_LessThan
- func (x *UInt64Rules) GetLt() uint64
- func (x *UInt64Rules) GetLte() uint64
- func (x *UInt64Rules) GetNotIn() []uint64
- func (x *UInt64Rules) HasConst() bool
- func (x *UInt64Rules) HasGreaterThan() bool
- func (x *UInt64Rules) HasGt() bool
- func (x *UInt64Rules) HasGte() bool
- func (x *UInt64Rules) HasLessThan() bool
- func (x *UInt64Rules) HasLt() bool
- func (x *UInt64Rules) HasLte() bool
- func (*UInt64Rules) ProtoMessage()
- func (x *UInt64Rules) ProtoReflect() protoreflect.Message
- func (x *UInt64Rules) Reset()
- func (x *UInt64Rules) SetConst(v uint64)
- func (x *UInt64Rules) SetExample(v []uint64)
- func (x *UInt64Rules) SetGt(v uint64)
- func (x *UInt64Rules) SetGte(v uint64)
- func (x *UInt64Rules) SetIn(v []uint64)
- func (x *UInt64Rules) SetLt(v uint64)
- func (x *UInt64Rules) SetLte(v uint64)
- func (x *UInt64Rules) SetNotIn(v []uint64)
- func (x *UInt64Rules) String() string
- func (x *UInt64Rules) WhichGreaterThan() case_UInt64Rules_GreaterThan
- func (x *UInt64Rules) WhichLessThan() case_UInt64Rules_LessThan
- type UInt64Rules_Gt
- type UInt64Rules_Gte
- type UInt64Rules_Lt
- type UInt64Rules_Lte
- type UInt64Rules_builder
- type Violation
- func (x *Violation) ClearField()
- func (x *Violation) ClearForKey()
- func (x *Violation) ClearMessage()
- func (x *Violation) ClearRule()
- func (x *Violation) ClearRuleId()
- func (x *Violation) GetField() *FieldPath
- func (x *Violation) GetForKey() bool
- func (x *Violation) GetMessage() string
- func (x *Violation) GetRule() *FieldPath
- func (x *Violation) GetRuleId() string
- func (x *Violation) HasField() bool
- func (x *Violation) HasForKey() bool
- func (x *Violation) HasMessage() bool
- func (x *Violation) HasRule() bool
- func (x *Violation) HasRuleId() bool
- func (*Violation) ProtoMessage()
- func (x *Violation) ProtoReflect() protoreflect.Message
- func (x *Violation) Reset()
- func (x *Violation) SetField(v *FieldPath)
- func (x *Violation) SetForKey(v bool)
- func (x *Violation) SetMessage(v string)
- func (x *Violation) SetRule(v *FieldPath)
- func (x *Violation) SetRuleId(v string)
- func (x *Violation) String() string
- type Violation_builder
- type Violations
- type Violations_builder
Constants ¶
const BytesRules_Ip_case case_BytesRules_WellKnown = 10
const BytesRules_Ipv4_case case_BytesRules_WellKnown = 11
const BytesRules_Ipv6_case case_BytesRules_WellKnown = 12
const BytesRules_Uuid_case case_BytesRules_WellKnown = 15
const BytesRules_WellKnown_not_set_case case_BytesRules_WellKnown = 0
const DoubleRules_GreaterThan_not_set_case case_DoubleRules_GreaterThan = 0
const DoubleRules_Gt_case case_DoubleRules_GreaterThan = 4
const DoubleRules_Gte_case case_DoubleRules_GreaterThan = 5
const DoubleRules_LessThan_not_set_case case_DoubleRules_LessThan = 0
const DoubleRules_Lt_case case_DoubleRules_LessThan = 2
const DoubleRules_Lte_case case_DoubleRules_LessThan = 3
const DurationRules_GreaterThan_not_set_case case_DurationRules_GreaterThan = 0
const DurationRules_Gt_case case_DurationRules_GreaterThan = 5
const DurationRules_Gte_case case_DurationRules_GreaterThan = 6
const DurationRules_LessThan_not_set_case case_DurationRules_LessThan = 0
const DurationRules_Lt_case case_DurationRules_LessThan = 3
const DurationRules_Lte_case case_DurationRules_LessThan = 4
const FieldPathElement_BoolKey_case case_FieldPathElement_Subscript = 7
const FieldPathElement_Index_case case_FieldPathElement_Subscript = 6
const FieldPathElement_IntKey_case case_FieldPathElement_Subscript = 8
const FieldPathElement_StringKey_case case_FieldPathElement_Subscript = 10
const FieldPathElement_Subscript_not_set_case case_FieldPathElement_Subscript = 0
const FieldPathElement_UintKey_case case_FieldPathElement_Subscript = 9
const FieldRules_Any_case case_FieldRules_Type = 20
const FieldRules_Bool_case case_FieldRules_Type = 13
const FieldRules_Bytes_case case_FieldRules_Type = 15
const FieldRules_Double_case case_FieldRules_Type = 2
const FieldRules_Duration_case case_FieldRules_Type = 21
const FieldRules_Enum_case case_FieldRules_Type = 16
const FieldRules_FieldMask_case case_FieldRules_Type = 28
const FieldRules_Fixed32_case case_FieldRules_Type = 9
const FieldRules_Fixed64_case case_FieldRules_Type = 10
const FieldRules_Float_case case_FieldRules_Type = 1
const FieldRules_Int32_case case_FieldRules_Type = 3
const FieldRules_Int64_case case_FieldRules_Type = 4
const FieldRules_Map_case case_FieldRules_Type = 19
const FieldRules_Repeated_case case_FieldRules_Type = 18
const FieldRules_Sfixed32_case case_FieldRules_Type = 11
const FieldRules_Sfixed64_case case_FieldRules_Type = 12
const FieldRules_Sint32_case case_FieldRules_Type = 7
const FieldRules_Sint64_case case_FieldRules_Type = 8
const FieldRules_String__case case_FieldRules_Type = 14
const FieldRules_Timestamp_case case_FieldRules_Type = 22
const FieldRules_Type_not_set_case case_FieldRules_Type = 0
const FieldRules_Uint32_case case_FieldRules_Type = 5
const FieldRules_Uint64_case case_FieldRules_Type = 6
const Fixed32Rules_GreaterThan_not_set_case case_Fixed32Rules_GreaterThan = 0
const Fixed32Rules_Gt_case case_Fixed32Rules_GreaterThan = 4
const Fixed32Rules_Gte_case case_Fixed32Rules_GreaterThan = 5
const Fixed32Rules_LessThan_not_set_case case_Fixed32Rules_LessThan = 0
const Fixed32Rules_Lt_case case_Fixed32Rules_LessThan = 2
const Fixed32Rules_Lte_case case_Fixed32Rules_LessThan = 3
const Fixed64Rules_GreaterThan_not_set_case case_Fixed64Rules_GreaterThan = 0
const Fixed64Rules_Gt_case case_Fixed64Rules_GreaterThan = 4
const Fixed64Rules_Gte_case case_Fixed64Rules_GreaterThan = 5
const Fixed64Rules_LessThan_not_set_case case_Fixed64Rules_LessThan = 0
const Fixed64Rules_Lt_case case_Fixed64Rules_LessThan = 2
const Fixed64Rules_Lte_case case_Fixed64Rules_LessThan = 3
const FloatRules_GreaterThan_not_set_case case_FloatRules_GreaterThan = 0
const FloatRules_Gt_case case_FloatRules_GreaterThan = 4
const FloatRules_Gte_case case_FloatRules_GreaterThan = 5
const FloatRules_LessThan_not_set_case case_FloatRules_LessThan = 0
const FloatRules_Lt_case case_FloatRules_LessThan = 2
const FloatRules_Lte_case case_FloatRules_LessThan = 3
const Int32Rules_GreaterThan_not_set_case case_Int32Rules_GreaterThan = 0
const Int32Rules_Gt_case case_Int32Rules_GreaterThan = 4
const Int32Rules_Gte_case case_Int32Rules_GreaterThan = 5
const Int32Rules_LessThan_not_set_case case_Int32Rules_LessThan = 0
const Int32Rules_Lt_case case_Int32Rules_LessThan = 2
const Int32Rules_Lte_case case_Int32Rules_LessThan = 3
const Int64Rules_GreaterThan_not_set_case case_Int64Rules_GreaterThan = 0
const Int64Rules_Gt_case case_Int64Rules_GreaterThan = 4
const Int64Rules_Gte_case case_Int64Rules_GreaterThan = 5
const Int64Rules_LessThan_not_set_case case_Int64Rules_LessThan = 0
const Int64Rules_Lt_case case_Int64Rules_LessThan = 2
const Int64Rules_Lte_case case_Int64Rules_LessThan = 3
const SFixed32Rules_GreaterThan_not_set_case case_SFixed32Rules_GreaterThan = 0
const SFixed32Rules_Gt_case case_SFixed32Rules_GreaterThan = 4
const SFixed32Rules_Gte_case case_SFixed32Rules_GreaterThan = 5
const SFixed32Rules_LessThan_not_set_case case_SFixed32Rules_LessThan = 0
const SFixed32Rules_Lt_case case_SFixed32Rules_LessThan = 2
const SFixed32Rules_Lte_case case_SFixed32Rules_LessThan = 3
const SFixed64Rules_GreaterThan_not_set_case case_SFixed64Rules_GreaterThan = 0
const SFixed64Rules_Gt_case case_SFixed64Rules_GreaterThan = 4
const SFixed64Rules_Gte_case case_SFixed64Rules_GreaterThan = 5
const SFixed64Rules_LessThan_not_set_case case_SFixed64Rules_LessThan = 0
const SFixed64Rules_Lt_case case_SFixed64Rules_LessThan = 2
const SFixed64Rules_Lte_case case_SFixed64Rules_LessThan = 3
const SInt32Rules_GreaterThan_not_set_case case_SInt32Rules_GreaterThan = 0
const SInt32Rules_Gt_case case_SInt32Rules_GreaterThan = 4
const SInt32Rules_Gte_case case_SInt32Rules_GreaterThan = 5
const SInt32Rules_LessThan_not_set_case case_SInt32Rules_LessThan = 0
const SInt32Rules_Lt_case case_SInt32Rules_LessThan = 2
const SInt32Rules_Lte_case case_SInt32Rules_LessThan = 3
const SInt64Rules_GreaterThan_not_set_case case_SInt64Rules_GreaterThan = 0
const SInt64Rules_Gt_case case_SInt64Rules_GreaterThan = 4
const SInt64Rules_Gte_case case_SInt64Rules_GreaterThan = 5
const SInt64Rules_LessThan_not_set_case case_SInt64Rules_LessThan = 0
const SInt64Rules_Lt_case case_SInt64Rules_LessThan = 2
const SInt64Rules_Lte_case case_SInt64Rules_LessThan = 3
const StringRules_Address_case case_StringRules_WellKnown = 21
const StringRules_Email_case case_StringRules_WellKnown = 12
const StringRules_HostAndPort_case case_StringRules_WellKnown = 32
const StringRules_Hostname_case case_StringRules_WellKnown = 13
const StringRules_IpPrefix_case case_StringRules_WellKnown = 29
const StringRules_IpWithPrefixlen_case case_StringRules_WellKnown = 26
const StringRules_Ip_case case_StringRules_WellKnown = 14
const StringRules_Ipv4Prefix_case case_StringRules_WellKnown = 30
const StringRules_Ipv4WithPrefixlen_case case_StringRules_WellKnown = 27
const StringRules_Ipv4_case case_StringRules_WellKnown = 15
const StringRules_Ipv6Prefix_case case_StringRules_WellKnown = 31
const StringRules_Ipv6WithPrefixlen_case case_StringRules_WellKnown = 28
const StringRules_Ipv6_case case_StringRules_WellKnown = 16
const StringRules_ProtobufDotFqn_case case_StringRules_WellKnown = 38
const StringRules_ProtobufFqn_case case_StringRules_WellKnown = 37
const StringRules_Tuuid_case case_StringRules_WellKnown = 33
const StringRules_Ulid_case case_StringRules_WellKnown = 35
const StringRules_UriRef_case case_StringRules_WellKnown = 18
const StringRules_Uri_case case_StringRules_WellKnown = 17
const StringRules_Uuid_case case_StringRules_WellKnown = 22
const StringRules_WellKnownRegex_case case_StringRules_WellKnown = 24
const StringRules_WellKnown_not_set_case case_StringRules_WellKnown = 0
const TimestampRules_GreaterThan_not_set_case case_TimestampRules_GreaterThan = 0
const TimestampRules_GtNow_case case_TimestampRules_GreaterThan = 8
const TimestampRules_Gt_case case_TimestampRules_GreaterThan = 5
const TimestampRules_Gte_case case_TimestampRules_GreaterThan = 6
const TimestampRules_LessThan_not_set_case case_TimestampRules_LessThan = 0
const TimestampRules_LtNow_case case_TimestampRules_LessThan = 7
const TimestampRules_Lt_case case_TimestampRules_LessThan = 3
const TimestampRules_Lte_case case_TimestampRules_LessThan = 4
const UInt32Rules_GreaterThan_not_set_case case_UInt32Rules_GreaterThan = 0
const UInt32Rules_Gt_case case_UInt32Rules_GreaterThan = 4
const UInt32Rules_Gte_case case_UInt32Rules_GreaterThan = 5
const UInt32Rules_LessThan_not_set_case case_UInt32Rules_LessThan = 0
const UInt32Rules_Lt_case case_UInt32Rules_LessThan = 2
const UInt32Rules_Lte_case case_UInt32Rules_LessThan = 3
const UInt64Rules_GreaterThan_not_set_case case_UInt64Rules_GreaterThan = 0
const UInt64Rules_Gt_case case_UInt64Rules_GreaterThan = 4
const UInt64Rules_Gte_case case_UInt64Rules_GreaterThan = 5
const UInt64Rules_LessThan_not_set_case case_UInt64Rules_LessThan = 0
const UInt64Rules_Lt_case case_UInt64Rules_LessThan = 2
const UInt64Rules_Lte_case case_UInt64Rules_LessThan = 3
Variables ¶
var ( Ignore_name = map[int32]string{ 0: "IGNORE_UNSPECIFIED", 1: "IGNORE_IF_ZERO_VALUE", 3: "IGNORE_ALWAYS", } Ignore_value = map[string]int32{ "IGNORE_UNSPECIFIED": 0, "IGNORE_IF_ZERO_VALUE": 1, "IGNORE_ALWAYS": 3, } )
Enum value maps for Ignore.
var ( KnownRegex_name = map[int32]string{ 0: "KNOWN_REGEX_UNSPECIFIED", 1: "KNOWN_REGEX_HTTP_HEADER_NAME", 2: "KNOWN_REGEX_HTTP_HEADER_VALUE", } KnownRegex_value = map[string]int32{ "KNOWN_REGEX_UNSPECIFIED": 0, "KNOWN_REGEX_HTTP_HEADER_NAME": 1, "KNOWN_REGEX_HTTP_HEADER_VALUE": 2, } )
Enum value maps for KnownRegex.
var ( // Rules specify the validations to be performed on this field. By default, // no validation is performed against a field. // // optional buf.validate.FieldRules field = 1159; E_Field = &file_buf_validate_validate_proto_extTypes[2] // Specifies predefined rules. When extending a standard rule message, // this adds additional CEL expressions that apply when the extension is used. // // “`proto // // extend buf.validate.Int32Rules { // bool is_zero = 1001 [(buf.validate.predefined).cel = { // id: "int32.is_zero", // message: "must be zero", // expression: "!rule || this == 0", // }]; // } // // message Foo { // int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true]; // } // // “` // // optional buf.validate.PredefinedRules predefined = 1160; E_Predefined = &file_buf_validate_validate_proto_extTypes[3] )
Extension fields to descriptorpb.FieldOptions.
var ( // Rules specify the validations to be performed on this message. By default, // no validation is performed against a message. // // optional buf.validate.MessageRules message = 1159; E_Message = &file_buf_validate_validate_proto_extTypes[0] )
Extension fields to descriptorpb.MessageOptions.
var ( // Rules specify the validations to be performed on this oneof. By default, // no validation is performed against a oneof. // // optional buf.validate.OneofRules oneof = 1159; E_Oneof = &file_buf_validate_validate_proto_extTypes[1] )
Extension fields to descriptorpb.OneofOptions.
var File_buf_validate_validate_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AnyRules ¶
type AnyRules struct {
// `in` requires the field's `type_url` to be equal to one of the
// specified values. If it doesn't match any of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyAny {
// // The `value` field must have a `type_url` equal to one of the specified values.
// google.protobuf.Any value = 1 [(buf.validate.field).any = {
// in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]
// }];
// }
//
// “`
In []string `protobuf:"bytes,2,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.
//
// “`proto
//
// message MyAny {
// // The `value` field must not have a `type_url` equal to any of the specified values.
// google.protobuf.Any value = 1 [(buf.validate.field).any = {
// not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]
// }];
// }
//
// “`
NotIn []string `protobuf:"bytes,3,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// contains filtered or unexported fields
}
AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type.
func (*AnyRules) ProtoReflect ¶
func (x *AnyRules) ProtoReflect() protoreflect.Message
type AnyRules_builder ¶
type AnyRules_builder struct {
// `in` requires the field's `type_url` to be equal to one of the
// specified values. If it doesn't match any of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyAny {
// // The `value` field must have a `type_url` equal to one of the specified values.
// google.protobuf.Any value = 1 [(buf.validate.field).any = {
// in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]
// }];
// }
//
// “`
In []string
// `not_in` requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.
//
// “`proto
//
// message MyAny {
// // The `value` field must not have a `type_url` equal to any of the specified values.
// google.protobuf.Any value = 1 [(buf.validate.field).any = {
// not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]
// }];
// }
//
// “`
NotIn []string
// contains filtered or unexported fields
}
func (AnyRules_builder) Build ¶
func (b0 AnyRules_builder) Build() *AnyRules
type BoolRules ¶
type BoolRules struct {
// `const` requires the field value to exactly match the specified boolean value.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyBool {
// // value must equal true
// bool value = 1 [(buf.validate.field).bool.const = true];
// }
//
// “`
Const *bool `protobuf:"varint,1,opt,name=const" json:"const,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyBool {
// bool value = 1 [
// (buf.validate.field).bool.example = true,
// (buf.validate.field).bool.example = false
// ];
// }
//
// “`
Example []bool `protobuf:"varint,2,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
BoolRules describes the rules applied to `bool` values. These rules may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.
func (*BoolRules) ProtoReflect ¶
func (x *BoolRules) ProtoReflect() protoreflect.Message
type BoolRules_builder ¶
type BoolRules_builder struct {
// `const` requires the field value to exactly match the specified boolean value.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyBool {
// // value must equal true
// bool value = 1 [(buf.validate.field).bool.const = true];
// }
//
// “`
Const *bool
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyBool {
// bool value = 1 [
// (buf.validate.field).bool.example = true,
// (buf.validate.field).bool.example = false
// ];
// }
//
// “`
Example []bool
// contains filtered or unexported fields
}
func (BoolRules_builder) Build ¶
func (b0 BoolRules_builder) Build() *BoolRules
type BytesRules ¶
type BytesRules struct {
// `const` requires the field value to exactly match the specified bytes
// value. If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be "\x01\x02\x03\x04"
// bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
// }
//
// “`
Const []byte `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"`
// `len` requires the field value to have the specified length in bytes.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value length must be 4 bytes.
// optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
// }
//
// “`
Len *uint64 `protobuf:"varint,13,opt,name=len" json:"len,omitempty"`
// `min_len` requires the field value to have at least the specified minimum
// length in bytes.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value length must be at least 2 bytes.
// optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
// }
//
// “`
MinLen *uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen" json:"min_len,omitempty"`
// `max_len` requires the field value to have at most the specified maximum
// length in bytes.
// If the field value exceeds the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be at most 6 bytes.
// optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
// }
//
// “`
MaxLen *uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen" json:"max_len,omitempty"`
// `pattern` requires the field value to match the specified regular
// expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
// The value of the field must be valid UTF-8 or validation will fail with a
// runtime error.
// If the field value doesn't match the pattern, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value must match regex pattern "^[a-zA-Z0-9]+$".
// optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
// }
//
// “`
Pattern *string `protobuf:"bytes,4,opt,name=pattern" json:"pattern,omitempty"`
// `prefix` requires the field value to have the specified bytes at the
// beginning of the string.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value does not have prefix \x01\x02
// optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
// }
//
// “`
Prefix []byte `protobuf:"bytes,5,opt,name=prefix" json:"prefix,omitempty"`
// `suffix` requires the field value to have the specified bytes at the end
// of the string.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value does not have suffix \x03\x04
// optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
// }
//
// “`
Suffix []byte `protobuf:"bytes,6,opt,name=suffix" json:"suffix,omitempty"`
// `contains` requires the field value to have the specified bytes anywhere in
// the string.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value does not contain \x02\x03
// optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
// }
//
// “`
Contains []byte `protobuf:"bytes,7,opt,name=contains" json:"contains,omitempty"`
// `in` requires the field value to be equal to one of the specified
// values. If the field value doesn't match any of the specified values, an
// error message is generated.
//
// “`proto
//
// message MyBytes {
// // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
// optional bytes value = 1 [(buf.validate.field).bytes = { in: ["\x01\x02", "\x02\x03", "\x03\x04"] }];
// }
//
// “`
In [][]byte `protobuf:"bytes,8,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to be not equal to any of the specified
// values.
// If the field value matches any of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyBytes {
// // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
// optional bytes value = 1 [(buf.validate.field).bytes = { not_in: ["\x01\x02", "\x02\x03", "\x03\x04"] }];
// }
//
// “`
NotIn [][]byte `protobuf:"bytes,9,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// WellKnown rules provide advanced rules against common byte
// patterns
//
// Types that are valid to be assigned to WellKnown:
//
// *BytesRules_Ip
// *BytesRules_Ipv4
// *BytesRules_Ipv6
// *BytesRules_Uuid
WellKnown isBytesRules_WellKnown `protobuf_oneof:"well_known"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyBytes {
// bytes value = 1 [
// (buf.validate.field).bytes.example = "\x01\x02",
// (buf.validate.field).bytes.example = "\x02\x03"
// ];
// }
//
// “`
Example [][]byte `protobuf:"bytes,14,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
BytesRules describe the rules applied to `bytes` values. These rules may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.
func (*BytesRules) ClearConst ¶
func (x *BytesRules) ClearConst()
func (*BytesRules) ClearContains ¶
func (x *BytesRules) ClearContains()
func (*BytesRules) ClearIp ¶
func (x *BytesRules) ClearIp()
func (*BytesRules) ClearIpv4 ¶
func (x *BytesRules) ClearIpv4()
func (*BytesRules) ClearIpv6 ¶
func (x *BytesRules) ClearIpv6()
func (*BytesRules) ClearLen ¶
func (x *BytesRules) ClearLen()
func (*BytesRules) ClearMaxLen ¶
func (x *BytesRules) ClearMaxLen()
func (*BytesRules) ClearMinLen ¶
func (x *BytesRules) ClearMinLen()
func (*BytesRules) ClearPattern ¶
func (x *BytesRules) ClearPattern()
func (*BytesRules) ClearPrefix ¶
func (x *BytesRules) ClearPrefix()
func (*BytesRules) ClearSuffix ¶
func (x *BytesRules) ClearSuffix()
func (*BytesRules) ClearUuid ¶
func (x *BytesRules) ClearUuid()
func (*BytesRules) ClearWellKnown ¶
func (x *BytesRules) ClearWellKnown()
func (*BytesRules) GetConst ¶
func (x *BytesRules) GetConst() []byte
func (*BytesRules) GetContains ¶
func (x *BytesRules) GetContains() []byte
func (*BytesRules) GetExample ¶
func (x *BytesRules) GetExample() [][]byte
func (*BytesRules) GetIn ¶
func (x *BytesRules) GetIn() [][]byte
func (*BytesRules) GetIp ¶
func (x *BytesRules) GetIp() bool
func (*BytesRules) GetIpv4 ¶
func (x *BytesRules) GetIpv4() bool
func (*BytesRules) GetIpv6 ¶
func (x *BytesRules) GetIpv6() bool
func (*BytesRules) GetLen ¶
func (x *BytesRules) GetLen() uint64
func (*BytesRules) GetMaxLen ¶
func (x *BytesRules) GetMaxLen() uint64
func (*BytesRules) GetMinLen ¶
func (x *BytesRules) GetMinLen() uint64
func (*BytesRules) GetNotIn ¶
func (x *BytesRules) GetNotIn() [][]byte
func (*BytesRules) GetPattern ¶
func (x *BytesRules) GetPattern() string
func (*BytesRules) GetPrefix ¶
func (x *BytesRules) GetPrefix() []byte
func (*BytesRules) GetSuffix ¶
func (x *BytesRules) GetSuffix() []byte
func (*BytesRules) GetUuid ¶
func (x *BytesRules) GetUuid() bool
func (*BytesRules) GetWellKnown ¶
func (x *BytesRules) GetWellKnown() isBytesRules_WellKnown
func (*BytesRules) HasConst ¶
func (x *BytesRules) HasConst() bool
func (*BytesRules) HasContains ¶
func (x *BytesRules) HasContains() bool
func (*BytesRules) HasIp ¶
func (x *BytesRules) HasIp() bool
func (*BytesRules) HasIpv4 ¶
func (x *BytesRules) HasIpv4() bool
func (*BytesRules) HasIpv6 ¶
func (x *BytesRules) HasIpv6() bool
func (*BytesRules) HasLen ¶
func (x *BytesRules) HasLen() bool
func (*BytesRules) HasMaxLen ¶
func (x *BytesRules) HasMaxLen() bool
func (*BytesRules) HasMinLen ¶
func (x *BytesRules) HasMinLen() bool
func (*BytesRules) HasPattern ¶
func (x *BytesRules) HasPattern() bool
func (*BytesRules) HasPrefix ¶
func (x *BytesRules) HasPrefix() bool
func (*BytesRules) HasSuffix ¶
func (x *BytesRules) HasSuffix() bool
func (*BytesRules) HasUuid ¶
func (x *BytesRules) HasUuid() bool
func (*BytesRules) HasWellKnown ¶
func (x *BytesRules) HasWellKnown() bool
func (*BytesRules) ProtoMessage ¶
func (*BytesRules) ProtoMessage()
func (*BytesRules) ProtoReflect ¶
func (x *BytesRules) ProtoReflect() protoreflect.Message
func (*BytesRules) Reset ¶
func (x *BytesRules) Reset()
func (*BytesRules) SetConst ¶
func (x *BytesRules) SetConst(v []byte)
func (*BytesRules) SetContains ¶
func (x *BytesRules) SetContains(v []byte)
func (*BytesRules) SetExample ¶
func (x *BytesRules) SetExample(v [][]byte)
func (*BytesRules) SetIn ¶
func (x *BytesRules) SetIn(v [][]byte)
func (*BytesRules) SetIp ¶
func (x *BytesRules) SetIp(v bool)
func (*BytesRules) SetIpv4 ¶
func (x *BytesRules) SetIpv4(v bool)
func (*BytesRules) SetIpv6 ¶
func (x *BytesRules) SetIpv6(v bool)
func (*BytesRules) SetLen ¶
func (x *BytesRules) SetLen(v uint64)
func (*BytesRules) SetMaxLen ¶
func (x *BytesRules) SetMaxLen(v uint64)
func (*BytesRules) SetMinLen ¶
func (x *BytesRules) SetMinLen(v uint64)
func (*BytesRules) SetNotIn ¶
func (x *BytesRules) SetNotIn(v [][]byte)
func (*BytesRules) SetPattern ¶
func (x *BytesRules) SetPattern(v string)
func (*BytesRules) SetPrefix ¶
func (x *BytesRules) SetPrefix(v []byte)
func (*BytesRules) SetSuffix ¶
func (x *BytesRules) SetSuffix(v []byte)
func (*BytesRules) SetUuid ¶
func (x *BytesRules) SetUuid(v bool)
func (*BytesRules) String ¶
func (x *BytesRules) String() string
func (*BytesRules) WhichWellKnown ¶
func (x *BytesRules) WhichWellKnown() case_BytesRules_WellKnown
type BytesRules_Ip ¶
type BytesRules_Ip struct {
// `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
// If the field value doesn't meet this rule, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be a valid IP address
// optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
// }
//
// “`
Ip bool `protobuf:"varint,10,opt,name=ip,oneof"`
}
type BytesRules_Ipv4 ¶
type BytesRules_Ipv4 struct {
// `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
// If the field value doesn't meet this rule, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be a valid IPv4 address
// optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
// }
//
// “`
Ipv4 bool `protobuf:"varint,11,opt,name=ipv4,oneof"`
}
type BytesRules_Ipv6 ¶
type BytesRules_Ipv6 struct {
// `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
// If the field value doesn't meet this rule, an error message is generated.
// “`proto
//
// message MyBytes {
// // must be a valid IPv6 address
// optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
// }
//
// “`
Ipv6 bool `protobuf:"varint,12,opt,name=ipv6,oneof"`
}
type BytesRules_Uuid ¶
type BytesRules_Uuid struct {
// `uuid` ensures that the field value encodes 128-bit UUID data as defined
// by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).
// The field must contain exactly 16 bytes representing the UUID. If the
// field value isn't a valid UUID, an error message will be generated.
//
// “`proto
//
// message MyBytes {
// // must be a valid UUID
// optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];
// }
//
// “`
Uuid bool `protobuf:"varint,15,opt,name=uuid,oneof"`
}
type BytesRules_builder ¶
type BytesRules_builder struct {
// `const` requires the field value to exactly match the specified bytes
// value. If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be "\x01\x02\x03\x04"
// bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
// }
//
// “`
Const []byte
// `len` requires the field value to have the specified length in bytes.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value length must be 4 bytes.
// optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
// }
//
// “`
Len *uint64
// `min_len` requires the field value to have at least the specified minimum
// length in bytes.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value length must be at least 2 bytes.
// optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
// }
//
// “`
MinLen *uint64
// `max_len` requires the field value to have at most the specified maximum
// length in bytes.
// If the field value exceeds the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be at most 6 bytes.
// optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
// }
//
// “`
MaxLen *uint64
// `pattern` requires the field value to match the specified regular
// expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
// The value of the field must be valid UTF-8 or validation will fail with a
// runtime error.
// If the field value doesn't match the pattern, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value must match regex pattern "^[a-zA-Z0-9]+$".
// optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
// }
//
// “`
Pattern *string
// `prefix` requires the field value to have the specified bytes at the
// beginning of the string.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value does not have prefix \x01\x02
// optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
// }
//
// “`
Prefix []byte
// `suffix` requires the field value to have the specified bytes at the end
// of the string.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value does not have suffix \x03\x04
// optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
// }
//
// “`
Suffix []byte
// `contains` requires the field value to have the specified bytes anywhere in
// the string.
// If the field value doesn't meet the requirement, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // value does not contain \x02\x03
// optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
// }
//
// “`
Contains []byte
// `in` requires the field value to be equal to one of the specified
// values. If the field value doesn't match any of the specified values, an
// error message is generated.
//
// “`proto
//
// message MyBytes {
// // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
// optional bytes value = 1 [(buf.validate.field).bytes = { in: ["\x01\x02", "\x02\x03", "\x03\x04"] }];
// }
//
// “`
In [][]byte
// `not_in` requires the field value to be not equal to any of the specified
// values.
// If the field value matches any of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyBytes {
// // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
// optional bytes value = 1 [(buf.validate.field).bytes = { not_in: ["\x01\x02", "\x02\x03", "\x03\x04"] }];
// }
//
// “`
NotIn [][]byte
// Fields of oneof WellKnown:
// `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
// If the field value doesn't meet this rule, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be a valid IP address
// optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
// }
//
// “`
Ip *bool
// `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
// If the field value doesn't meet this rule, an error message is generated.
//
// “`proto
//
// message MyBytes {
// // must be a valid IPv4 address
// optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
// }
//
// “`
Ipv4 *bool
// `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
// If the field value doesn't meet this rule, an error message is generated.
// “`proto
//
// message MyBytes {
// // must be a valid IPv6 address
// optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
// }
//
// “`
Ipv6 *bool
// `uuid` ensures that the field value encodes 128-bit UUID data as defined
// by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).
// The field must contain exactly 16 bytes representing the UUID. If the
// field value isn't a valid UUID, an error message will be generated.
//
// “`proto
//
// message MyBytes {
// // must be a valid UUID
// optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];
// }
//
// “`
Uuid *bool
// -- end of WellKnown
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyBytes {
// bytes value = 1 [
// (buf.validate.field).bytes.example = "\x01\x02",
// (buf.validate.field).bytes.example = "\x02\x03"
// ];
// }
//
// “`
Example [][]byte
// contains filtered or unexported fields
}
func (BytesRules_builder) Build ¶
func (b0 BytesRules_builder) Build() *BytesRules
type DoubleRules ¶
type DoubleRules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyDouble {
// // value must equal 42.0
// double value = 1 [(buf.validate.field).double.const = 42.0];
// }
//
// “`
Const *float64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *DoubleRules_Lt
// *DoubleRules_Lte
LessThan isDoubleRules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *DoubleRules_Gt
// *DoubleRules_Gte
GreaterThan isDoubleRules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyDouble {
// // must be in list [1.0, 2.0, 3.0]
// double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];
// }
//
// “`
In []float64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyDouble {
// // value must not be in list [1.0, 2.0, 3.0]
// double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];
// }
//
// “`
NotIn []float64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `finite` requires the field value to be finite. If the field value is
// infinite or NaN, an error message is generated.
Finite *bool `protobuf:"varint,8,opt,name=finite" json:"finite,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyDouble {
// double value = 1 [
// (buf.validate.field).double.example = 1.0,
// (buf.validate.field).double.example = inf
// ];
// }
//
// “`
Example []float64 `protobuf:"fixed64,9,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
DoubleRules describes the rules applied to `double` values. These rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.
func (*DoubleRules) ClearConst ¶
func (x *DoubleRules) ClearConst()
func (*DoubleRules) ClearFinite ¶
func (x *DoubleRules) ClearFinite()
func (*DoubleRules) ClearGreaterThan ¶
func (x *DoubleRules) ClearGreaterThan()
func (*DoubleRules) ClearGt ¶
func (x *DoubleRules) ClearGt()
func (*DoubleRules) ClearGte ¶
func (x *DoubleRules) ClearGte()
func (*DoubleRules) ClearLessThan ¶
func (x *DoubleRules) ClearLessThan()
func (*DoubleRules) ClearLt ¶
func (x *DoubleRules) ClearLt()
func (*DoubleRules) ClearLte ¶
func (x *DoubleRules) ClearLte()
func (*DoubleRules) GetConst ¶
func (x *DoubleRules) GetConst() float64
func (*DoubleRules) GetExample ¶
func (x *DoubleRules) GetExample() []float64
func (*DoubleRules) GetFinite ¶
func (x *DoubleRules) GetFinite() bool
func (*DoubleRules) GetGreaterThan ¶
func (x *DoubleRules) GetGreaterThan() isDoubleRules_GreaterThan
func (*DoubleRules) GetGt ¶
func (x *DoubleRules) GetGt() float64
func (*DoubleRules) GetGte ¶
func (x *DoubleRules) GetGte() float64
func (*DoubleRules) GetIn ¶
func (x *DoubleRules) GetIn() []float64
func (*DoubleRules) GetLessThan ¶
func (x *DoubleRules) GetLessThan() isDoubleRules_LessThan
func (*DoubleRules) GetLt ¶
func (x *DoubleRules) GetLt() float64
func (*DoubleRules) GetLte ¶
func (x *DoubleRules) GetLte() float64
func (*DoubleRules) GetNotIn ¶
func (x *DoubleRules) GetNotIn() []float64
func (*DoubleRules) HasConst ¶
func (x *DoubleRules) HasConst() bool
func (*DoubleRules) HasFinite ¶
func (x *DoubleRules) HasFinite() bool
func (*DoubleRules) HasGreaterThan ¶
func (x *DoubleRules) HasGreaterThan() bool
func (*DoubleRules) HasGt ¶
func (x *DoubleRules) HasGt() bool
func (*DoubleRules) HasGte ¶
func (x *DoubleRules) HasGte() bool
func (*DoubleRules) HasLessThan ¶
func (x *DoubleRules) HasLessThan() bool
func (*DoubleRules) HasLt ¶
func (x *DoubleRules) HasLt() bool
func (*DoubleRules) HasLte ¶
func (x *DoubleRules) HasLte() bool
func (*DoubleRules) ProtoMessage ¶
func (*DoubleRules) ProtoMessage()
func (*DoubleRules) ProtoReflect ¶
func (x *DoubleRules) ProtoReflect() protoreflect.Message
func (*DoubleRules) Reset ¶
func (x *DoubleRules) Reset()
func (*DoubleRules) SetConst ¶
func (x *DoubleRules) SetConst(v float64)
func (*DoubleRules) SetExample ¶
func (x *DoubleRules) SetExample(v []float64)
func (*DoubleRules) SetFinite ¶
func (x *DoubleRules) SetFinite(v bool)
func (*DoubleRules) SetGt ¶
func (x *DoubleRules) SetGt(v float64)
func (*DoubleRules) SetGte ¶
func (x *DoubleRules) SetGte(v float64)
func (*DoubleRules) SetIn ¶
func (x *DoubleRules) SetIn(v []float64)
func (*DoubleRules) SetLt ¶
func (x *DoubleRules) SetLt(v float64)
func (*DoubleRules) SetLte ¶
func (x *DoubleRules) SetLte(v float64)
func (*DoubleRules) SetNotIn ¶
func (x *DoubleRules) SetNotIn(v []float64)
func (*DoubleRules) String ¶
func (x *DoubleRules) String() string
func (*DoubleRules) WhichGreaterThan ¶
func (x *DoubleRules) WhichGreaterThan() case_DoubleRules_GreaterThan
func (*DoubleRules) WhichLessThan ¶
func (x *DoubleRules) WhichLessThan() case_DoubleRules_LessThan
type DoubleRules_Gt ¶
type DoubleRules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,
// the range is reversed, and the field value must be outside the specified
// range. If the field value doesn't meet the required conditions, an error
// message is generated.
//
// “`proto
//
// message MyDouble {
// // must be greater than 5.0 [double.gt]
// double value = 1 [(buf.validate.field).double.gt = 5.0];
//
// // must be greater than 5 and less than 10.0 [double.gt_lt]
// double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];
//
// // must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]
// double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];
// }
//
// “`
Gt float64 `protobuf:"fixed64,4,opt,name=gt,oneof"`
}
type DoubleRules_Gte ¶
type DoubleRules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyDouble {
// // must be greater than or equal to 5.0 [double.gte]
// double value = 1 [(buf.validate.field).double.gte = 5.0];
//
// // must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]
// double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];
//
// // must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]
// double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];
// }
//
// “`
Gte float64 `protobuf:"fixed64,5,opt,name=gte,oneof"`
}
type DoubleRules_Lt ¶
type DoubleRules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyDouble {
// // must be less than 10.0
// double value = 1 [(buf.validate.field).double.lt = 10.0];
// }
//
// “`
Lt float64 `protobuf:"fixed64,2,opt,name=lt,oneof"`
}
type DoubleRules_Lte ¶
type DoubleRules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified value
// (field <= value). If the field value is greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyDouble {
// // must be less than or equal to 10.0
// double value = 1 [(buf.validate.field).double.lte = 10.0];
// }
//
// “`
Lte float64 `protobuf:"fixed64,3,opt,name=lte,oneof"`
}
type DoubleRules_builder ¶
type DoubleRules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyDouble {
// // value must equal 42.0
// double value = 1 [(buf.validate.field).double.const = 42.0];
// }
//
// “`
Const *float64
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyDouble {
// // must be less than 10.0
// double value = 1 [(buf.validate.field).double.lt = 10.0];
// }
//
// “`
Lt *float64
// `lte` requires the field value to be less than or equal to the specified value
// (field <= value). If the field value is greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyDouble {
// // must be less than or equal to 10.0
// double value = 1 [(buf.validate.field).double.lte = 10.0];
// }
//
// “`
Lte *float64
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,
// the range is reversed, and the field value must be outside the specified
// range. If the field value doesn't meet the required conditions, an error
// message is generated.
//
// “`proto
//
// message MyDouble {
// // must be greater than 5.0 [double.gt]
// double value = 1 [(buf.validate.field).double.gt = 5.0];
//
// // must be greater than 5 and less than 10.0 [double.gt_lt]
// double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];
//
// // must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]
// double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];
// }
//
// “`
Gt *float64
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyDouble {
// // must be greater than or equal to 5.0 [double.gte]
// double value = 1 [(buf.validate.field).double.gte = 5.0];
//
// // must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]
// double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];
//
// // must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]
// double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];
// }
//
// “`
Gte *float64
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyDouble {
// // must be in list [1.0, 2.0, 3.0]
// double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];
// }
//
// “`
In []float64
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyDouble {
// // value must not be in list [1.0, 2.0, 3.0]
// double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];
// }
//
// “`
NotIn []float64
// `finite` requires the field value to be finite. If the field value is
// infinite or NaN, an error message is generated.
Finite *bool
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyDouble {
// double value = 1 [
// (buf.validate.field).double.example = 1.0,
// (buf.validate.field).double.example = inf
// ];
// }
//
// “`
Example []float64
// contains filtered or unexported fields
}
func (DoubleRules_builder) Build ¶
func (b0 DoubleRules_builder) Build() *DoubleRules
type DurationRules ¶
type DurationRules struct {
// `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.
// If the field's value deviates from the specified value, an error message
// will be generated.
//
// “`proto
//
// message MyDuration {
// // value must equal 5s
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = { seconds: 5 }];
// }
//
// “`
Const *durationpb.Duration `protobuf:"bytes,2,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *DurationRules_Lt
// *DurationRules_Lte
LessThan isDurationRules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *DurationRules_Gt
// *DurationRules_Gte
GreaterThan isDurationRules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.
// If the field's value doesn't correspond to any of the specified values,
// an error message will be generated.
//
// “`proto
//
// message MyDuration {
// // must be in list [1s, 2s, 3s]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration = {
// in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }]
// }];
// }
//
// “`
In []*durationpb.Duration `protobuf:"bytes,7,rep,name=in" json:"in,omitempty"`
// `not_in` denotes that the field must not be equal to
// any of the specified values of the `google.protobuf.Duration` type.
// If the field's value matches any of these values, an error message will be
// generated.
//
// “`proto
//
// message MyDuration {
// // value must not be in list [1s, 2s, 3s]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration = {
// not_in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }]
// }];
// }
//
// “`
NotIn []*durationpb.Duration `protobuf:"bytes,8,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyDuration {
// google.protobuf.Duration value = 1 [
// (buf.validate.field).duration.example = { seconds: 1 },
// (buf.validate.field).duration.example = { seconds: 2 }
// ];
// }
//
// “`
Example []*durationpb.Duration `protobuf:"bytes,9,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type.
func (*DurationRules) ClearConst ¶
func (x *DurationRules) ClearConst()
func (*DurationRules) ClearGreaterThan ¶
func (x *DurationRules) ClearGreaterThan()
func (*DurationRules) ClearGt ¶
func (x *DurationRules) ClearGt()
func (*DurationRules) ClearGte ¶
func (x *DurationRules) ClearGte()
func (*DurationRules) ClearLessThan ¶
func (x *DurationRules) ClearLessThan()
func (*DurationRules) ClearLt ¶
func (x *DurationRules) ClearLt()
func (*DurationRules) ClearLte ¶
func (x *DurationRules) ClearLte()
func (*DurationRules) GetConst ¶
func (x *DurationRules) GetConst() *durationpb.Duration
func (*DurationRules) GetExample ¶
func (x *DurationRules) GetExample() []*durationpb.Duration
func (*DurationRules) GetGreaterThan ¶
func (x *DurationRules) GetGreaterThan() isDurationRules_GreaterThan
func (*DurationRules) GetGt ¶
func (x *DurationRules) GetGt() *durationpb.Duration
func (*DurationRules) GetGte ¶
func (x *DurationRules) GetGte() *durationpb.Duration
func (*DurationRules) GetIn ¶
func (x *DurationRules) GetIn() []*durationpb.Duration
func (*DurationRules) GetLessThan ¶
func (x *DurationRules) GetLessThan() isDurationRules_LessThan
func (*DurationRules) GetLt ¶
func (x *DurationRules) GetLt() *durationpb.Duration
func (*DurationRules) GetLte ¶
func (x *DurationRules) GetLte() *durationpb.Duration
func (*DurationRules) GetNotIn ¶
func (x *DurationRules) GetNotIn() []*durationpb.Duration
func (*DurationRules) HasConst ¶
func (x *DurationRules) HasConst() bool
func (*DurationRules) HasGreaterThan ¶
func (x *DurationRules) HasGreaterThan() bool
func (*DurationRules) HasGt ¶
func (x *DurationRules) HasGt() bool
func (*DurationRules) HasGte ¶
func (x *DurationRules) HasGte() bool
func (*DurationRules) HasLessThan ¶
func (x *DurationRules) HasLessThan() bool
func (*DurationRules) HasLt ¶
func (x *DurationRules) HasLt() bool
func (*DurationRules) HasLte ¶
func (x *DurationRules) HasLte() bool
func (*DurationRules) ProtoMessage ¶
func (*DurationRules) ProtoMessage()
func (*DurationRules) ProtoReflect ¶
func (x *DurationRules) ProtoReflect() protoreflect.Message
func (*DurationRules) Reset ¶
func (x *DurationRules) Reset()
func (*DurationRules) SetConst ¶
func (x *DurationRules) SetConst(v *durationpb.Duration)
func (*DurationRules) SetExample ¶
func (x *DurationRules) SetExample(v []*durationpb.Duration)
func (*DurationRules) SetGt ¶
func (x *DurationRules) SetGt(v *durationpb.Duration)
func (*DurationRules) SetGte ¶
func (x *DurationRules) SetGte(v *durationpb.Duration)
func (*DurationRules) SetIn ¶
func (x *DurationRules) SetIn(v []*durationpb.Duration)
func (*DurationRules) SetLt ¶
func (x *DurationRules) SetLt(v *durationpb.Duration)
func (*DurationRules) SetLte ¶
func (x *DurationRules) SetLte(v *durationpb.Duration)
func (*DurationRules) SetNotIn ¶
func (x *DurationRules) SetNotIn(v []*durationpb.Duration)
func (*DurationRules) String ¶
func (x *DurationRules) String() string
func (*DurationRules) WhichGreaterThan ¶
func (x *DurationRules) WhichGreaterThan() case_DurationRules_GreaterThan
func (*DurationRules) WhichLessThan ¶
func (x *DurationRules) WhichLessThan() case_DurationRules_LessThan
type DurationRules_Gt ¶
type DurationRules_Gt struct {
// `gt` requires the duration field value to be greater than the specified
// value (exclusive). If the value of `gt` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyDuration {
// // duration must be greater than 5s [duration.gt]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];
//
// // duration must be greater than 5s and less than 10s [duration.gt_lt]
// google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];
//
// // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]
// google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];
// }
//
// “`
Gt *durationpb.Duration `protobuf:"bytes,5,opt,name=gt,oneof"`
}
type DurationRules_Gte ¶
type DurationRules_Gte struct {
// `gte` requires the duration field value to be greater than or equal to the
// specified value (exclusive). If the value of `gte` is larger than a
// specified `lt` or `lte`, the range is reversed, and the field value must
// be outside the specified range. If the field value doesn't meet the
// required conditions, an error message is generated.
//
// “`proto
//
// message MyDuration {
// // duration must be greater than or equal to 5s [duration.gte]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];
//
// // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]
// google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];
//
// // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]
// google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];
// }
//
// “`
Gte *durationpb.Duration `protobuf:"bytes,6,opt,name=gte,oneof"`
}
type DurationRules_Lt ¶
type DurationRules_Lt struct {
// `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,
// exclusive. If the field's value is greater than or equal to the specified
// value, an error message will be generated.
//
// “`proto
//
// message MyDuration {
// // must be less than 5s
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 5 }];
// }
//
// “`
Lt *durationpb.Duration `protobuf:"bytes,3,opt,name=lt,oneof"`
}
type DurationRules_Lte ¶
type DurationRules_Lte struct {
// `lte` indicates that the field must be less than or equal to the specified
// value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,
// an error message will be generated.
//
// “`proto
//
// message MyDuration {
// // must be less than or equal to 10s
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = { seconds: 10 }];
// }
//
// “`
Lte *durationpb.Duration `protobuf:"bytes,4,opt,name=lte,oneof"`
}
type DurationRules_builder ¶
type DurationRules_builder struct {
// `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.
// If the field's value deviates from the specified value, an error message
// will be generated.
//
// “`proto
//
// message MyDuration {
// // value must equal 5s
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = { seconds: 5 }];
// }
//
// “`
Const *durationpb.Duration
// Fields of oneof LessThan:
// `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,
// exclusive. If the field's value is greater than or equal to the specified
// value, an error message will be generated.
//
// “`proto
//
// message MyDuration {
// // must be less than 5s
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 5 }];
// }
//
// “`
Lt *durationpb.Duration
// `lte` indicates that the field must be less than or equal to the specified
// value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,
// an error message will be generated.
//
// “`proto
//
// message MyDuration {
// // must be less than or equal to 10s
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = { seconds: 10 }];
// }
//
// “`
Lte *durationpb.Duration
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the duration field value to be greater than the specified
// value (exclusive). If the value of `gt` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyDuration {
// // duration must be greater than 5s [duration.gt]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];
//
// // duration must be greater than 5s and less than 10s [duration.gt_lt]
// google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];
//
// // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]
// google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];
// }
//
// “`
Gt *durationpb.Duration
// `gte` requires the duration field value to be greater than or equal to the
// specified value (exclusive). If the value of `gte` is larger than a
// specified `lt` or `lte`, the range is reversed, and the field value must
// be outside the specified range. If the field value doesn't meet the
// required conditions, an error message is generated.
//
// “`proto
//
// message MyDuration {
// // duration must be greater than or equal to 5s [duration.gte]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];
//
// // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]
// google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];
//
// // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]
// google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];
// }
//
// “`
Gte *durationpb.Duration
// -- end of GreaterThan
// `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.
// If the field's value doesn't correspond to any of the specified values,
// an error message will be generated.
//
// “`proto
//
// message MyDuration {
// // must be in list [1s, 2s, 3s]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration = {
// in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }]
// }];
// }
//
// “`
In []*durationpb.Duration
// `not_in` denotes that the field must not be equal to
// any of the specified values of the `google.protobuf.Duration` type.
// If the field's value matches any of these values, an error message will be
// generated.
//
// “`proto
//
// message MyDuration {
// // value must not be in list [1s, 2s, 3s]
// google.protobuf.Duration value = 1 [(buf.validate.field).duration = {
// not_in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }]
// }];
// }
//
// “`
NotIn []*durationpb.Duration
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyDuration {
// google.protobuf.Duration value = 1 [
// (buf.validate.field).duration.example = { seconds: 1 },
// (buf.validate.field).duration.example = { seconds: 2 }
// ];
// }
//
// “`
Example []*durationpb.Duration
// contains filtered or unexported fields
}
func (DurationRules_builder) Build ¶
func (b0 DurationRules_builder) Build() *DurationRules
type EnumRules ¶
type EnumRules struct {
// `const` requires the field value to exactly match the specified enum value.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must be exactly MY_ENUM_VALUE1.
// MyEnum value = 1 [(buf.validate.field).enum.const = 1];
// }
//
// “`
Const *int32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"`
// `defined_only` requires the field value to be one of the defined values for
// this enum, failing on any undefined value.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must be a defined value of MyEnum.
// MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
// }
//
// “`
DefinedOnly *bool `protobuf:"varint,2,opt,name=defined_only,json=definedOnly" json:"defined_only,omitempty"`
// `in` requires the field value to be equal to one of the
// specified enum values. If the field value doesn't match any of the
// specified values, an error message is generated.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must be equal to one of the specified values.
// MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
// }
//
// “`
In []int32 `protobuf:"varint,3,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to be not equal to any of the
// specified enum values. If the field value matches one of the specified
// values, an error message is generated.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must not be equal to any of the specified values.
// MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
// }
//
// “`
NotIn []int32 `protobuf:"varint,4,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// MyEnum value = 1 [
// (buf.validate.field).enum.example = 1,
// (buf.validate.field).enum.example = 2
// ];
// }
//
// “`
Example []int32 `protobuf:"varint,5,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
EnumRules describe the rules applied to `enum` values.
func (*EnumRules) ProtoReflect ¶
func (x *EnumRules) ProtoReflect() protoreflect.Message
type EnumRules_builder ¶
type EnumRules_builder struct {
// `const` requires the field value to exactly match the specified enum value.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must be exactly MY_ENUM_VALUE1.
// MyEnum value = 1 [(buf.validate.field).enum.const = 1];
// }
//
// “`
Const *int32
// `defined_only` requires the field value to be one of the defined values for
// this enum, failing on any undefined value.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must be a defined value of MyEnum.
// MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
// }
//
// “`
DefinedOnly *bool
// `in` requires the field value to be equal to one of the
// specified enum values. If the field value doesn't match any of the
// specified values, an error message is generated.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must be equal to one of the specified values.
// MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
// }
//
// “`
In []int32
// `not_in` requires the field value to be not equal to any of the
// specified enum values. If the field value matches one of the specified
// values, an error message is generated.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// // The field `value` must not be equal to any of the specified values.
// MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
// }
//
// “`
NotIn []int32
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// enum MyEnum {
// MY_ENUM_UNSPECIFIED = 0;
// MY_ENUM_VALUE1 = 1;
// MY_ENUM_VALUE2 = 2;
// }
//
// message MyMessage {
// MyEnum value = 1 [
// (buf.validate.field).enum.example = 1,
// (buf.validate.field).enum.example = 2
// ];
// }
//
// “`
Example []int32
// contains filtered or unexported fields
}
func (EnumRules_builder) Build ¶
func (b0 EnumRules_builder) Build() *EnumRules
type FieldMaskRules ¶
type FieldMaskRules struct {
// `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.
// If the field's value deviates from the specified value, an error message
// will be generated.
//
// “`proto
//
// message MyFieldMask {
// // value must equal ["a"]
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {
// paths: ["a"]
// }];
// }
//
// “`
Const *fieldmaskpb.FieldMask `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"`
// `in` requires the field value to only contain paths matching specified
// values or their subpaths.
// If any of the field value's paths doesn't match the rule,
// an error message is generated.
// See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
//
// “`proto
//
// message MyFieldMask {
// // The `value` FieldMask must only contain paths listed in `in`.
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
// in: ["a", "b", "c.a"]
// }];
// }
//
// “`
In []string `protobuf:"bytes,2,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not contain paths matching specified
// values or their subpaths.
// If any of the field value's paths matches the rule,
// an error message is generated.
// See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
//
// “`proto
//
// message MyFieldMask {
// // The `value` FieldMask shall not contain paths listed in `not_in`.
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
// not_in: ["forbidden", "immutable", "c.a"]
// }];
// }
//
// “`
NotIn []string `protobuf:"bytes,3,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFieldMask {
// google.protobuf.FieldMask value = 1 [
// (buf.validate.field).field_mask.example = { paths: ["a", "b"] },
// (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] }
// ];
// }
//
// “`
Example []*fieldmaskpb.FieldMask `protobuf:"bytes,4,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type.
func (*FieldMaskRules) ClearConst ¶
func (x *FieldMaskRules) ClearConst()
func (*FieldMaskRules) GetConst ¶
func (x *FieldMaskRules) GetConst() *fieldmaskpb.FieldMask
func (*FieldMaskRules) GetExample ¶
func (x *FieldMaskRules) GetExample() []*fieldmaskpb.FieldMask
func (*FieldMaskRules) GetIn ¶
func (x *FieldMaskRules) GetIn() []string
func (*FieldMaskRules) GetNotIn ¶
func (x *FieldMaskRules) GetNotIn() []string
func (*FieldMaskRules) HasConst ¶
func (x *FieldMaskRules) HasConst() bool
func (*FieldMaskRules) ProtoMessage ¶
func (*FieldMaskRules) ProtoMessage()
func (*FieldMaskRules) ProtoReflect ¶
func (x *FieldMaskRules) ProtoReflect() protoreflect.Message
func (*FieldMaskRules) Reset ¶
func (x *FieldMaskRules) Reset()
func (*FieldMaskRules) SetConst ¶
func (x *FieldMaskRules) SetConst(v *fieldmaskpb.FieldMask)
func (*FieldMaskRules) SetExample ¶
func (x *FieldMaskRules) SetExample(v []*fieldmaskpb.FieldMask)
func (*FieldMaskRules) SetIn ¶
func (x *FieldMaskRules) SetIn(v []string)
func (*FieldMaskRules) SetNotIn ¶
func (x *FieldMaskRules) SetNotIn(v []string)
func (*FieldMaskRules) String ¶
func (x *FieldMaskRules) String() string
type FieldMaskRules_builder ¶
type FieldMaskRules_builder struct {
// `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.
// If the field's value deviates from the specified value, an error message
// will be generated.
//
// “`proto
//
// message MyFieldMask {
// // value must equal ["a"]
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {
// paths: ["a"]
// }];
// }
//
// “`
Const *fieldmaskpb.FieldMask
// `in` requires the field value to only contain paths matching specified
// values or their subpaths.
// If any of the field value's paths doesn't match the rule,
// an error message is generated.
// See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
//
// “`proto
//
// message MyFieldMask {
// // The `value` FieldMask must only contain paths listed in `in`.
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
// in: ["a", "b", "c.a"]
// }];
// }
//
// “`
In []string
// `not_in` requires the field value to not contain paths matching specified
// values or their subpaths.
// If any of the field value's paths matches the rule,
// an error message is generated.
// See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
//
// “`proto
//
// message MyFieldMask {
// // The `value` FieldMask shall not contain paths listed in `not_in`.
// google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
// not_in: ["forbidden", "immutable", "c.a"]
// }];
// }
//
// “`
NotIn []string
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFieldMask {
// google.protobuf.FieldMask value = 1 [
// (buf.validate.field).field_mask.example = { paths: ["a", "b"] },
// (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] }
// ];
// }
//
// “`
Example []*fieldmaskpb.FieldMask
// contains filtered or unexported fields
}
func (FieldMaskRules_builder) Build ¶
func (b0 FieldMaskRules_builder) Build() *FieldMaskRules
type FieldPath ¶
type FieldPath struct {
// `elements` contains each element of the path, starting from the root and recursing downward.
Elements []*FieldPathElement `protobuf:"bytes,1,rep,name=elements" json:"elements,omitempty"`
// contains filtered or unexported fields
}
`FieldPath` provides a path to a nested protobuf field.
This message provides enough information to render a dotted field path even without protobuf descriptors. It also provides enough information to resolve a nested field through unknown wire data.
func (*FieldPath) GetElements ¶
func (x *FieldPath) GetElements() []*FieldPathElement
func (*FieldPath) ProtoReflect ¶
func (x *FieldPath) ProtoReflect() protoreflect.Message
func (*FieldPath) SetElements ¶
func (x *FieldPath) SetElements(v []*FieldPathElement)
type FieldPathElement ¶
type FieldPathElement struct {
// `field_number` is the field number this path element refers to.
FieldNumber *int32 `protobuf:"varint,1,opt,name=field_number,json=fieldNumber" json:"field_number,omitempty"`
// `field_name` contains the field name this path element refers to.
// This can be used to display a human-readable path even if the field number is unknown.
FieldName *string `protobuf:"bytes,2,opt,name=field_name,json=fieldName" json:"field_name,omitempty"`
// `field_type` specifies the type of this field. When using reflection, this value is not needed.
//
// This value is provided to make it possible to traverse unknown fields through wire data.
// When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.
//
// N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and
// can be explicitly used in Protocol Buffers 2023 Edition.
//
// [1]: https://protobuf.dev/programming-guides/encoding/#packed
// [2]: https://protobuf.dev/programming-guides/encoding/#groups
FieldType *descriptorpb.FieldDescriptorProto_Type `` /* 129-byte string literal not displayed */
// `key_type` specifies the map key type of this field. This value is useful when traversing
// unknown fields through wire data: specifically, it allows handling the differences between
// different integer encodings.
KeyType *descriptorpb.FieldDescriptorProto_Type `protobuf:"varint,4,opt,name=key_type,json=keyType,enum=google.protobuf.FieldDescriptorProto_Type" json:"key_type,omitempty"`
// `value_type` specifies map value type of this field. This is useful if you want to display a
// value inside unknown fields through wire data.
ValueType *descriptorpb.FieldDescriptorProto_Type `` /* 129-byte string literal not displayed */
// `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field.
//
// Types that are valid to be assigned to Subscript:
//
// *FieldPathElement_Index
// *FieldPathElement_BoolKey
// *FieldPathElement_IntKey
// *FieldPathElement_UintKey
// *FieldPathElement_StringKey
Subscript isFieldPathElement_Subscript `protobuf_oneof:"subscript"`
// contains filtered or unexported fields
}
`FieldPathElement` provides enough information to nest through a single protobuf field.
If the selected field is a map or repeated field, the `subscript` value selects a specific element from it. A path that refers to a value nested under a map key or repeated field index will have a `subscript` value. The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.
func (*FieldPathElement) ClearBoolKey ¶
func (x *FieldPathElement) ClearBoolKey()
func (*FieldPathElement) ClearFieldName ¶
func (x *FieldPathElement) ClearFieldName()
func (*FieldPathElement) ClearFieldNumber ¶
func (x *FieldPathElement) ClearFieldNumber()
func (*FieldPathElement) ClearFieldType ¶
func (x *FieldPathElement) ClearFieldType()
func (*FieldPathElement) ClearIndex ¶
func (x *FieldPathElement) ClearIndex()
func (*FieldPathElement) ClearIntKey ¶
func (x *FieldPathElement) ClearIntKey()
func (*FieldPathElement) ClearKeyType ¶
func (x *FieldPathElement) ClearKeyType()
func (*FieldPathElement) ClearStringKey ¶
func (x *FieldPathElement) ClearStringKey()
func (*FieldPathElement) ClearSubscript ¶
func (x *FieldPathElement) ClearSubscript()
func (*FieldPathElement) ClearUintKey ¶
func (x *FieldPathElement) ClearUintKey()
func (*FieldPathElement) ClearValueType ¶
func (x *FieldPathElement) ClearValueType()
func (*FieldPathElement) GetBoolKey ¶
func (x *FieldPathElement) GetBoolKey() bool
func (*FieldPathElement) GetFieldName ¶
func (x *FieldPathElement) GetFieldName() string
func (*FieldPathElement) GetFieldNumber ¶
func (x *FieldPathElement) GetFieldNumber() int32
func (*FieldPathElement) GetFieldType ¶
func (x *FieldPathElement) GetFieldType() descriptorpb.FieldDescriptorProto_Type
func (*FieldPathElement) GetIndex ¶
func (x *FieldPathElement) GetIndex() uint64
func (*FieldPathElement) GetIntKey ¶
func (x *FieldPathElement) GetIntKey() int64
func (*FieldPathElement) GetKeyType ¶
func (x *FieldPathElement) GetKeyType() descriptorpb.FieldDescriptorProto_Type
func (*FieldPathElement) GetStringKey ¶
func (x *FieldPathElement) GetStringKey() string
func (*FieldPathElement) GetSubscript ¶
func (x *FieldPathElement) GetSubscript() isFieldPathElement_Subscript
func (*FieldPathElement) GetUintKey ¶
func (x *FieldPathElement) GetUintKey() uint64
func (*FieldPathElement) GetValueType ¶
func (x *FieldPathElement) GetValueType() descriptorpb.FieldDescriptorProto_Type
func (*FieldPathElement) HasBoolKey ¶
func (x *FieldPathElement) HasBoolKey() bool
func (*FieldPathElement) HasFieldName ¶
func (x *FieldPathElement) HasFieldName() bool
func (*FieldPathElement) HasFieldNumber ¶
func (x *FieldPathElement) HasFieldNumber() bool
func (*FieldPathElement) HasFieldType ¶
func (x *FieldPathElement) HasFieldType() bool
func (*FieldPathElement) HasIndex ¶
func (x *FieldPathElement) HasIndex() bool
func (*FieldPathElement) HasIntKey ¶
func (x *FieldPathElement) HasIntKey() bool
func (*FieldPathElement) HasKeyType ¶
func (x *FieldPathElement) HasKeyType() bool
func (*FieldPathElement) HasStringKey ¶
func (x *FieldPathElement) HasStringKey() bool
func (*FieldPathElement) HasSubscript ¶
func (x *FieldPathElement) HasSubscript() bool
func (*FieldPathElement) HasUintKey ¶
func (x *FieldPathElement) HasUintKey() bool
func (*FieldPathElement) HasValueType ¶
func (x *FieldPathElement) HasValueType() bool
func (*FieldPathElement) ProtoMessage ¶
func (*FieldPathElement) ProtoMessage()
func (*FieldPathElement) ProtoReflect ¶
func (x *FieldPathElement) ProtoReflect() protoreflect.Message
func (*FieldPathElement) Reset ¶
func (x *FieldPathElement) Reset()
func (*FieldPathElement) SetBoolKey ¶
func (x *FieldPathElement) SetBoolKey(v bool)
func (*FieldPathElement) SetFieldName ¶
func (x *FieldPathElement) SetFieldName(v string)
func (*FieldPathElement) SetFieldNumber ¶
func (x *FieldPathElement) SetFieldNumber(v int32)
func (*FieldPathElement) SetFieldType ¶
func (x *FieldPathElement) SetFieldType(v descriptorpb.FieldDescriptorProto_Type)
func (*FieldPathElement) SetIndex ¶
func (x *FieldPathElement) SetIndex(v uint64)
func (*FieldPathElement) SetIntKey ¶
func (x *FieldPathElement) SetIntKey(v int64)
func (*FieldPathElement) SetKeyType ¶
func (x *FieldPathElement) SetKeyType(v descriptorpb.FieldDescriptorProto_Type)
func (*FieldPathElement) SetStringKey ¶
func (x *FieldPathElement) SetStringKey(v string)
func (*FieldPathElement) SetUintKey ¶
func (x *FieldPathElement) SetUintKey(v uint64)
func (*FieldPathElement) SetValueType ¶
func (x *FieldPathElement) SetValueType(v descriptorpb.FieldDescriptorProto_Type)
func (*FieldPathElement) String ¶
func (x *FieldPathElement) String() string
func (*FieldPathElement) WhichSubscript ¶
func (x *FieldPathElement) WhichSubscript() case_FieldPathElement_Subscript
type FieldPathElement_BoolKey ¶
type FieldPathElement_BoolKey struct {
// `bool_key` specifies a map key of type bool.
BoolKey bool `protobuf:"varint,7,opt,name=bool_key,json=boolKey,oneof"`
}
type FieldPathElement_Index ¶
type FieldPathElement_Index struct {
// `index` specifies a 0-based index into a repeated field.
Index uint64 `protobuf:"varint,6,opt,name=index,oneof"`
}
type FieldPathElement_IntKey ¶
type FieldPathElement_IntKey struct {
// `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.
IntKey int64 `protobuf:"varint,8,opt,name=int_key,json=intKey,oneof"`
}
type FieldPathElement_StringKey ¶
type FieldPathElement_StringKey struct {
// `string_key` specifies a map key of type string.
StringKey string `protobuf:"bytes,10,opt,name=string_key,json=stringKey,oneof"`
}
type FieldPathElement_UintKey ¶
type FieldPathElement_UintKey struct {
// `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.
UintKey uint64 `protobuf:"varint,9,opt,name=uint_key,json=uintKey,oneof"`
}
type FieldPathElement_builder ¶
type FieldPathElement_builder struct {
// `field_number` is the field number this path element refers to.
FieldNumber *int32
// `field_name` contains the field name this path element refers to.
// This can be used to display a human-readable path even if the field number is unknown.
FieldName *string
// `field_type` specifies the type of this field. When using reflection, this value is not needed.
//
// This value is provided to make it possible to traverse unknown fields through wire data.
// When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.
//
// N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and
// can be explicitly used in Protocol Buffers 2023 Edition.
//
// [1]: https://protobuf.dev/programming-guides/encoding/#packed
// [2]: https://protobuf.dev/programming-guides/encoding/#groups
FieldType *descriptorpb.FieldDescriptorProto_Type
// `key_type` specifies the map key type of this field. This value is useful when traversing
// unknown fields through wire data: specifically, it allows handling the differences between
// different integer encodings.
KeyType *descriptorpb.FieldDescriptorProto_Type
// `value_type` specifies map value type of this field. This is useful if you want to display a
// value inside unknown fields through wire data.
ValueType *descriptorpb.FieldDescriptorProto_Type
// Fields of oneof Subscript:
// `index` specifies a 0-based index into a repeated field.
Index *uint64
// `bool_key` specifies a map key of type bool.
BoolKey *bool
// `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.
IntKey *int64
// `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.
UintKey *uint64
// `string_key` specifies a map key of type string.
StringKey *string
// contains filtered or unexported fields
}
func (FieldPathElement_builder) Build ¶
func (b0 FieldPathElement_builder) Build() *FieldPathElement
type FieldPath_builder ¶
type FieldPath_builder struct {
// `elements` contains each element of the path, starting from the root and recursing downward.
Elements []*FieldPathElement
// contains filtered or unexported fields
}
func (FieldPath_builder) Build ¶
func (b0 FieldPath_builder) Build() *FieldPath
type FieldRules ¶
type FieldRules struct {
// `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation
// rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.
//
// This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for
// simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will
// be same as the `expression`.
//
// For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `value` must be greater than 42.
// optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"];
// }
//
// “`
CelExpression []string `protobuf:"bytes,29,rep,name=cel_expression,json=celExpression" json:"cel_expression,omitempty"`
// `cel` is a repeated field used to represent a textual expression
// in the Common Expression Language (CEL) syntax. For more information,
// [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `value` must be greater than 42.
// optional int32 value = 1 [(buf.validate.field).cel = {
// id: "my_message.value",
// message: "must be greater than 42",
// expression: "this > 42",
// }];
// }
//
// “`
Cel []*Rule `protobuf:"bytes,23,rep,name=cel" json:"cel,omitempty"`
// If `required` is true, the field must be set. A validation error is returned
// if the field is not set.
//
// “`proto
// syntax="proto3";
//
// message FieldsWithPresence {
// // Requires any string to be set, including the empty string.
// optional string link = 1 [
// (buf.validate.field).required = true
// ];
// // Requires true or false to be set.
// optional bool disabled = 2 [
// (buf.validate.field).required = true
// ];
// // Requires a message to be set, including the empty message.
// SomeMessage msg = 4 [
// (buf.validate.field).required = true
// ];
// }
//
// “`
//
// All fields in the example above track presence. By default, Protovalidate
// ignores rules on those fields if no value is set. `required` ensures that
// the fields are set and valid.
//
// Fields that don't track presence are always validated by Protovalidate,
// whether they are set or not. It is not necessary to add `required`. It
// can be added to indicate that the field cannot be the zero value.
//
// “`proto
// syntax="proto3";
//
// message FieldsWithoutPresence {
// // `string.email` always applies, even to an empty string.
// string link = 1 [
// (buf.validate.field).string.email = true
// ];
// // `repeated.min_items` always applies, even to an empty list.
// repeated string labels = 2 [
// (buf.validate.field).repeated.min_items = 1
// ];
// // `required`, for fields that don't track presence, indicates
// // the value of the field can't be the zero value.
// int32 zero_value_not_allowed = 3 [
// (buf.validate.field).required = true
// ];
// }
//
// “`
//
// To learn which fields track presence, see the
// [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).
//
// Note: While field rules can be applied to repeated items, map keys, and map
// values, the elements are always considered to be set. Consequently,
// specifying `repeated.items.required` is redundant.
Required *bool `protobuf:"varint,25,opt,name=required" json:"required,omitempty"`
// Ignore validation rules on the field if its value matches the specified
// criteria. See the `Ignore` enum for details.
//
// “`proto
//
// message UpdateRequest {
// // The uri rule only applies if the field is not an empty string.
// string url = 1 [
// (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,
// (buf.validate.field).string.uri = true
// ];
// }
//
// “`
Ignore *Ignore `protobuf:"varint,27,opt,name=ignore,enum=buf.validate.Ignore" json:"ignore,omitempty"`
// Types that are valid to be assigned to Type:
//
// *FieldRules_Float
// *FieldRules_Double
// *FieldRules_Int32
// *FieldRules_Int64
// *FieldRules_Uint32
// *FieldRules_Uint64
// *FieldRules_Sint32
// *FieldRules_Sint64
// *FieldRules_Fixed32
// *FieldRules_Fixed64
// *FieldRules_Sfixed32
// *FieldRules_Sfixed64
// *FieldRules_Bool
// *FieldRules_String_
// *FieldRules_Bytes
// *FieldRules_Enum
// *FieldRules_Repeated
// *FieldRules_Map
// *FieldRules_Any
// *FieldRules_Duration
// *FieldRules_FieldMask
// *FieldRules_Timestamp
Type isFieldRules_Type `protobuf_oneof:"type"`
// contains filtered or unexported fields
}
FieldRules encapsulates the rules for each type of field. Depending on the field, the correct set should be used to ensure proper validations.
func (*FieldRules) ClearAny ¶
func (x *FieldRules) ClearAny()
func (*FieldRules) ClearBool ¶
func (x *FieldRules) ClearBool()
func (*FieldRules) ClearBytes ¶
func (x *FieldRules) ClearBytes()
func (*FieldRules) ClearDouble ¶
func (x *FieldRules) ClearDouble()
func (*FieldRules) ClearDuration ¶
func (x *FieldRules) ClearDuration()
func (*FieldRules) ClearEnum ¶
func (x *FieldRules) ClearEnum()
func (*FieldRules) ClearFieldMask ¶
func (x *FieldRules) ClearFieldMask()
func (*FieldRules) ClearFixed32 ¶
func (x *FieldRules) ClearFixed32()
func (*FieldRules) ClearFixed64 ¶
func (x *FieldRules) ClearFixed64()
func (*FieldRules) ClearFloat ¶
func (x *FieldRules) ClearFloat()
func (*FieldRules) ClearIgnore ¶
func (x *FieldRules) ClearIgnore()
func (*FieldRules) ClearInt32 ¶
func (x *FieldRules) ClearInt32()
func (*FieldRules) ClearInt64 ¶
func (x *FieldRules) ClearInt64()
func (*FieldRules) ClearMap ¶
func (x *FieldRules) ClearMap()
func (*FieldRules) ClearRepeated ¶
func (x *FieldRules) ClearRepeated()
func (*FieldRules) ClearRequired ¶
func (x *FieldRules) ClearRequired()
func (*FieldRules) ClearSfixed32 ¶
func (x *FieldRules) ClearSfixed32()
func (*FieldRules) ClearSfixed64 ¶
func (x *FieldRules) ClearSfixed64()
func (*FieldRules) ClearSint32 ¶
func (x *FieldRules) ClearSint32()
func (*FieldRules) ClearSint64 ¶
func (x *FieldRules) ClearSint64()
func (*FieldRules) ClearString ¶
func (x *FieldRules) ClearString()
func (*FieldRules) ClearTimestamp ¶
func (x *FieldRules) ClearTimestamp()
func (*FieldRules) ClearType ¶
func (x *FieldRules) ClearType()
func (*FieldRules) ClearUint32 ¶
func (x *FieldRules) ClearUint32()
func (*FieldRules) ClearUint64 ¶
func (x *FieldRules) ClearUint64()
func (*FieldRules) GetAny ¶
func (x *FieldRules) GetAny() *AnyRules
func (*FieldRules) GetBool ¶
func (x *FieldRules) GetBool() *BoolRules
func (*FieldRules) GetBytes ¶
func (x *FieldRules) GetBytes() *BytesRules
func (*FieldRules) GetCel ¶
func (x *FieldRules) GetCel() []*Rule
func (*FieldRules) GetCelExpression ¶
func (x *FieldRules) GetCelExpression() []string
func (*FieldRules) GetDouble ¶
func (x *FieldRules) GetDouble() *DoubleRules
func (*FieldRules) GetDuration ¶
func (x *FieldRules) GetDuration() *DurationRules
func (*FieldRules) GetEnum ¶
func (x *FieldRules) GetEnum() *EnumRules
func (*FieldRules) GetFieldMask ¶
func (x *FieldRules) GetFieldMask() *FieldMaskRules
func (*FieldRules) GetFixed32 ¶
func (x *FieldRules) GetFixed32() *Fixed32Rules
func (*FieldRules) GetFixed64 ¶
func (x *FieldRules) GetFixed64() *Fixed64Rules
func (*FieldRules) GetFloat ¶
func (x *FieldRules) GetFloat() *FloatRules
func (*FieldRules) GetIgnore ¶
func (x *FieldRules) GetIgnore() Ignore
func (*FieldRules) GetInt32 ¶
func (x *FieldRules) GetInt32() *Int32Rules
func (*FieldRules) GetInt64 ¶
func (x *FieldRules) GetInt64() *Int64Rules
func (*FieldRules) GetMap ¶
func (x *FieldRules) GetMap() *MapRules
func (*FieldRules) GetRepeated ¶
func (x *FieldRules) GetRepeated() *RepeatedRules
func (*FieldRules) GetRequired ¶
func (x *FieldRules) GetRequired() bool
func (*FieldRules) GetSfixed32 ¶
func (x *FieldRules) GetSfixed32() *SFixed32Rules
func (*FieldRules) GetSfixed64 ¶
func (x *FieldRules) GetSfixed64() *SFixed64Rules
func (*FieldRules) GetSint32 ¶
func (x *FieldRules) GetSint32() *SInt32Rules
func (*FieldRules) GetSint64 ¶
func (x *FieldRules) GetSint64() *SInt64Rules
func (*FieldRules) GetString ¶
func (x *FieldRules) GetString() *StringRules
func (*FieldRules) GetString_
deprecated
func (x *FieldRules) GetString_() *StringRules
Deprecated: Use GetString instead.
func (*FieldRules) GetTimestamp ¶
func (x *FieldRules) GetTimestamp() *TimestampRules
func (*FieldRules) GetType ¶
func (x *FieldRules) GetType() isFieldRules_Type
func (*FieldRules) GetUint32 ¶
func (x *FieldRules) GetUint32() *UInt32Rules
func (*FieldRules) GetUint64 ¶
func (x *FieldRules) GetUint64() *UInt64Rules
func (*FieldRules) HasAny ¶
func (x *FieldRules) HasAny() bool
func (*FieldRules) HasBool ¶
func (x *FieldRules) HasBool() bool
func (*FieldRules) HasBytes ¶
func (x *FieldRules) HasBytes() bool
func (*FieldRules) HasDouble ¶
func (x *FieldRules) HasDouble() bool
func (*FieldRules) HasDuration ¶
func (x *FieldRules) HasDuration() bool
func (*FieldRules) HasEnum ¶
func (x *FieldRules) HasEnum() bool
func (*FieldRules) HasFieldMask ¶
func (x *FieldRules) HasFieldMask() bool
func (*FieldRules) HasFixed32 ¶
func (x *FieldRules) HasFixed32() bool
func (*FieldRules) HasFixed64 ¶
func (x *FieldRules) HasFixed64() bool
func (*FieldRules) HasFloat ¶
func (x *FieldRules) HasFloat() bool
func (*FieldRules) HasIgnore ¶
func (x *FieldRules) HasIgnore() bool
func (*FieldRules) HasInt32 ¶
func (x *FieldRules) HasInt32() bool
func (*FieldRules) HasInt64 ¶
func (x *FieldRules) HasInt64() bool
func (*FieldRules) HasMap ¶
func (x *FieldRules) HasMap() bool
func (*FieldRules) HasRepeated ¶
func (x *FieldRules) HasRepeated() bool
func (*FieldRules) HasRequired ¶
func (x *FieldRules) HasRequired() bool
func (*FieldRules) HasSfixed32 ¶
func (x *FieldRules) HasSfixed32() bool
func (*FieldRules) HasSfixed64 ¶
func (x *FieldRules) HasSfixed64() bool
func (*FieldRules) HasSint32 ¶
func (x *FieldRules) HasSint32() bool
func (*FieldRules) HasSint64 ¶
func (x *FieldRules) HasSint64() bool
func (*FieldRules) HasString ¶
func (x *FieldRules) HasString() bool
func (*FieldRules) HasTimestamp ¶
func (x *FieldRules) HasTimestamp() bool
func (*FieldRules) HasType ¶
func (x *FieldRules) HasType() bool
func (*FieldRules) HasUint32 ¶
func (x *FieldRules) HasUint32() bool
func (*FieldRules) HasUint64 ¶
func (x *FieldRules) HasUint64() bool
func (*FieldRules) ProtoMessage ¶
func (*FieldRules) ProtoMessage()
func (*FieldRules) ProtoReflect ¶
func (x *FieldRules) ProtoReflect() protoreflect.Message
func (*FieldRules) Reset ¶
func (x *FieldRules) Reset()
func (*FieldRules) SetAny ¶
func (x *FieldRules) SetAny(v *AnyRules)
func (*FieldRules) SetBool ¶
func (x *FieldRules) SetBool(v *BoolRules)
func (*FieldRules) SetBytes ¶
func (x *FieldRules) SetBytes(v *BytesRules)
func (*FieldRules) SetCel ¶
func (x *FieldRules) SetCel(v []*Rule)
func (*FieldRules) SetCelExpression ¶
func (x *FieldRules) SetCelExpression(v []string)
func (*FieldRules) SetDouble ¶
func (x *FieldRules) SetDouble(v *DoubleRules)
func (*FieldRules) SetDuration ¶
func (x *FieldRules) SetDuration(v *DurationRules)
func (*FieldRules) SetEnum ¶
func (x *FieldRules) SetEnum(v *EnumRules)
func (*FieldRules) SetFieldMask ¶
func (x *FieldRules) SetFieldMask(v *FieldMaskRules)
func (*FieldRules) SetFixed32 ¶
func (x *FieldRules) SetFixed32(v *Fixed32Rules)
func (*FieldRules) SetFixed64 ¶
func (x *FieldRules) SetFixed64(v *Fixed64Rules)
func (*FieldRules) SetFloat ¶
func (x *FieldRules) SetFloat(v *FloatRules)
func (*FieldRules) SetIgnore ¶
func (x *FieldRules) SetIgnore(v Ignore)
func (*FieldRules) SetInt32 ¶
func (x *FieldRules) SetInt32(v *Int32Rules)
func (*FieldRules) SetInt64 ¶
func (x *FieldRules) SetInt64(v *Int64Rules)
func (*FieldRules) SetMap ¶
func (x *FieldRules) SetMap(v *MapRules)
func (*FieldRules) SetRepeated ¶
func (x *FieldRules) SetRepeated(v *RepeatedRules)
func (*FieldRules) SetRequired ¶
func (x *FieldRules) SetRequired(v bool)
func (*FieldRules) SetSfixed32 ¶
func (x *FieldRules) SetSfixed32(v *SFixed32Rules)
func (*FieldRules) SetSfixed64 ¶
func (x *FieldRules) SetSfixed64(v *SFixed64Rules)
func (*FieldRules) SetSint32 ¶
func (x *FieldRules) SetSint32(v *SInt32Rules)
func (*FieldRules) SetSint64 ¶
func (x *FieldRules) SetSint64(v *SInt64Rules)
func (*FieldRules) SetString ¶
func (x *FieldRules) SetString(v *StringRules)
func (*FieldRules) SetTimestamp ¶
func (x *FieldRules) SetTimestamp(v *TimestampRules)
func (*FieldRules) SetUint32 ¶
func (x *FieldRules) SetUint32(v *UInt32Rules)
func (*FieldRules) SetUint64 ¶
func (x *FieldRules) SetUint64(v *UInt64Rules)
func (*FieldRules) String ¶
func (x *FieldRules) String() string
func (*FieldRules) WhichType ¶
func (x *FieldRules) WhichType() case_FieldRules_Type
type FieldRules_Any ¶
type FieldRules_Any struct {
// Well-Known Field Types
Any *AnyRules `protobuf:"bytes,20,opt,name=any,oneof"`
}
type FieldRules_Bool ¶
type FieldRules_Bool struct {
Bool *BoolRules `protobuf:"bytes,13,opt,name=bool,oneof"`
}
type FieldRules_Bytes ¶
type FieldRules_Bytes struct {
Bytes *BytesRules `protobuf:"bytes,15,opt,name=bytes,oneof"`
}
type FieldRules_Double ¶
type FieldRules_Double struct {
Double *DoubleRules `protobuf:"bytes,2,opt,name=double,oneof"`
}
type FieldRules_Duration ¶
type FieldRules_Duration struct {
Duration *DurationRules `protobuf:"bytes,21,opt,name=duration,oneof"`
}
type FieldRules_Enum ¶
type FieldRules_Enum struct {
// Complex Field Types
Enum *EnumRules `protobuf:"bytes,16,opt,name=enum,oneof"`
}
type FieldRules_FieldMask ¶
type FieldRules_FieldMask struct {
FieldMask *FieldMaskRules `protobuf:"bytes,28,opt,name=field_mask,json=fieldMask,oneof"`
}
type FieldRules_Fixed32 ¶
type FieldRules_Fixed32 struct {
Fixed32 *Fixed32Rules `protobuf:"bytes,9,opt,name=fixed32,oneof"`
}
type FieldRules_Fixed64 ¶
type FieldRules_Fixed64 struct {
Fixed64 *Fixed64Rules `protobuf:"bytes,10,opt,name=fixed64,oneof"`
}
type FieldRules_Float ¶
type FieldRules_Float struct {
// Scalar Field Types
Float *FloatRules `protobuf:"bytes,1,opt,name=float,oneof"`
}
type FieldRules_Int32 ¶
type FieldRules_Int32 struct {
Int32 *Int32Rules `protobuf:"bytes,3,opt,name=int32,oneof"`
}
type FieldRules_Int64 ¶
type FieldRules_Int64 struct {
Int64 *Int64Rules `protobuf:"bytes,4,opt,name=int64,oneof"`
}
type FieldRules_Map ¶
type FieldRules_Map struct {
Map *MapRules `protobuf:"bytes,19,opt,name=map,oneof"`
}
type FieldRules_Repeated ¶
type FieldRules_Repeated struct {
Repeated *RepeatedRules `protobuf:"bytes,18,opt,name=repeated,oneof"`
}
type FieldRules_Sfixed32 ¶
type FieldRules_Sfixed32 struct {
Sfixed32 *SFixed32Rules `protobuf:"bytes,11,opt,name=sfixed32,oneof"`
}
type FieldRules_Sfixed64 ¶
type FieldRules_Sfixed64 struct {
Sfixed64 *SFixed64Rules `protobuf:"bytes,12,opt,name=sfixed64,oneof"`
}
type FieldRules_Sint32 ¶
type FieldRules_Sint32 struct {
Sint32 *SInt32Rules `protobuf:"bytes,7,opt,name=sint32,oneof"`
}
type FieldRules_Sint64 ¶
type FieldRules_Sint64 struct {
Sint64 *SInt64Rules `protobuf:"bytes,8,opt,name=sint64,oneof"`
}
type FieldRules_String_ ¶
type FieldRules_String_ struct {
String_ *StringRules `protobuf:"bytes,14,opt,name=string,oneof"`
}
type FieldRules_Timestamp ¶
type FieldRules_Timestamp struct {
Timestamp *TimestampRules `protobuf:"bytes,22,opt,name=timestamp,oneof"`
}
type FieldRules_Uint32 ¶
type FieldRules_Uint32 struct {
Uint32 *UInt32Rules `protobuf:"bytes,5,opt,name=uint32,oneof"`
}
type FieldRules_Uint64 ¶
type FieldRules_Uint64 struct {
Uint64 *UInt64Rules `protobuf:"bytes,6,opt,name=uint64,oneof"`
}
type FieldRules_builder ¶
type FieldRules_builder struct {
// `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation
// rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.
//
// This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for
// simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will
// be same as the `expression`.
//
// For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `value` must be greater than 42.
// optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"];
// }
//
// “`
CelExpression []string
// `cel` is a repeated field used to represent a textual expression
// in the Common Expression Language (CEL) syntax. For more information,
// [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `value` must be greater than 42.
// optional int32 value = 1 [(buf.validate.field).cel = {
// id: "my_message.value",
// message: "must be greater than 42",
// expression: "this > 42",
// }];
// }
//
// “`
Cel []*Rule
// If `required` is true, the field must be set. A validation error is returned
// if the field is not set.
//
// “`proto
// syntax="proto3";
//
// message FieldsWithPresence {
// // Requires any string to be set, including the empty string.
// optional string link = 1 [
// (buf.validate.field).required = true
// ];
// // Requires true or false to be set.
// optional bool disabled = 2 [
// (buf.validate.field).required = true
// ];
// // Requires a message to be set, including the empty message.
// SomeMessage msg = 4 [
// (buf.validate.field).required = true
// ];
// }
//
// “`
//
// All fields in the example above track presence. By default, Protovalidate
// ignores rules on those fields if no value is set. `required` ensures that
// the fields are set and valid.
//
// Fields that don't track presence are always validated by Protovalidate,
// whether they are set or not. It is not necessary to add `required`. It
// can be added to indicate that the field cannot be the zero value.
//
// “`proto
// syntax="proto3";
//
// message FieldsWithoutPresence {
// // `string.email` always applies, even to an empty string.
// string link = 1 [
// (buf.validate.field).string.email = true
// ];
// // `repeated.min_items` always applies, even to an empty list.
// repeated string labels = 2 [
// (buf.validate.field).repeated.min_items = 1
// ];
// // `required`, for fields that don't track presence, indicates
// // the value of the field can't be the zero value.
// int32 zero_value_not_allowed = 3 [
// (buf.validate.field).required = true
// ];
// }
//
// “`
//
// To learn which fields track presence, see the
// [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).
//
// Note: While field rules can be applied to repeated items, map keys, and map
// values, the elements are always considered to be set. Consequently,
// specifying `repeated.items.required` is redundant.
Required *bool
// Ignore validation rules on the field if its value matches the specified
// criteria. See the `Ignore` enum for details.
//
// “`proto
//
// message UpdateRequest {
// // The uri rule only applies if the field is not an empty string.
// string url = 1 [
// (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,
// (buf.validate.field).string.uri = true
// ];
// }
//
// “`
Ignore *Ignore
// Fields of oneof Type:
// Scalar Field Types
Float *FloatRules
Double *DoubleRules
Int32 *Int32Rules
Int64 *Int64Rules
Uint32 *UInt32Rules
Uint64 *UInt64Rules
Sint32 *SInt32Rules
Sint64 *SInt64Rules
Fixed32 *Fixed32Rules
Fixed64 *Fixed64Rules
Sfixed32 *SFixed32Rules
Sfixed64 *SFixed64Rules
Bool *BoolRules
String *StringRules
Bytes *BytesRules
// Complex Field Types
Enum *EnumRules
Repeated *RepeatedRules
Map *MapRules
// Well-Known Field Types
Any *AnyRules
Duration *DurationRules
FieldMask *FieldMaskRules
Timestamp *TimestampRules
// contains filtered or unexported fields
}
func (FieldRules_builder) Build ¶
func (b0 FieldRules_builder) Build() *FieldRules
type Fixed32Rules ¶
type Fixed32Rules struct {
// `const` requires the field value to exactly match the specified value.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // value must equal 42
// fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];
// }
//
// “`
Const *uint32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *Fixed32Rules_Lt
// *Fixed32Rules_Lte
LessThan isFixed32Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *Fixed32Rules_Gt
// *Fixed32Rules_Gte
GreaterThan isFixed32Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be in list [1, 2, 3]
// fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyFixed32 {
// // value must not be in list [1, 2, 3]
// fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFixed32 {
// fixed32 value = 1 [
// (buf.validate.field).fixed32.example = 1,
// (buf.validate.field).fixed32.example = 2
// ];
// }
//
// “`
Example []uint32 `protobuf:"fixed32,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
Fixed32Rules describes the rules applied to `fixed32` values.
func (*Fixed32Rules) ClearConst ¶
func (x *Fixed32Rules) ClearConst()
func (*Fixed32Rules) ClearGreaterThan ¶
func (x *Fixed32Rules) ClearGreaterThan()
func (*Fixed32Rules) ClearGt ¶
func (x *Fixed32Rules) ClearGt()
func (*Fixed32Rules) ClearGte ¶
func (x *Fixed32Rules) ClearGte()
func (*Fixed32Rules) ClearLessThan ¶
func (x *Fixed32Rules) ClearLessThan()
func (*Fixed32Rules) ClearLt ¶
func (x *Fixed32Rules) ClearLt()
func (*Fixed32Rules) ClearLte ¶
func (x *Fixed32Rules) ClearLte()
func (*Fixed32Rules) GetConst ¶
func (x *Fixed32Rules) GetConst() uint32
func (*Fixed32Rules) GetExample ¶
func (x *Fixed32Rules) GetExample() []uint32
func (*Fixed32Rules) GetGreaterThan ¶
func (x *Fixed32Rules) GetGreaterThan() isFixed32Rules_GreaterThan
func (*Fixed32Rules) GetGt ¶
func (x *Fixed32Rules) GetGt() uint32
func (*Fixed32Rules) GetGte ¶
func (x *Fixed32Rules) GetGte() uint32
func (*Fixed32Rules) GetIn ¶
func (x *Fixed32Rules) GetIn() []uint32
func (*Fixed32Rules) GetLessThan ¶
func (x *Fixed32Rules) GetLessThan() isFixed32Rules_LessThan
func (*Fixed32Rules) GetLt ¶
func (x *Fixed32Rules) GetLt() uint32
func (*Fixed32Rules) GetLte ¶
func (x *Fixed32Rules) GetLte() uint32
func (*Fixed32Rules) GetNotIn ¶
func (x *Fixed32Rules) GetNotIn() []uint32
func (*Fixed32Rules) HasConst ¶
func (x *Fixed32Rules) HasConst() bool
func (*Fixed32Rules) HasGreaterThan ¶
func (x *Fixed32Rules) HasGreaterThan() bool
func (*Fixed32Rules) HasGt ¶
func (x *Fixed32Rules) HasGt() bool
func (*Fixed32Rules) HasGte ¶
func (x *Fixed32Rules) HasGte() bool
func (*Fixed32Rules) HasLessThan ¶
func (x *Fixed32Rules) HasLessThan() bool
func (*Fixed32Rules) HasLt ¶
func (x *Fixed32Rules) HasLt() bool
func (*Fixed32Rules) HasLte ¶
func (x *Fixed32Rules) HasLte() bool
func (*Fixed32Rules) ProtoMessage ¶
func (*Fixed32Rules) ProtoMessage()
func (*Fixed32Rules) ProtoReflect ¶
func (x *Fixed32Rules) ProtoReflect() protoreflect.Message
func (*Fixed32Rules) Reset ¶
func (x *Fixed32Rules) Reset()
func (*Fixed32Rules) SetConst ¶
func (x *Fixed32Rules) SetConst(v uint32)
func (*Fixed32Rules) SetExample ¶
func (x *Fixed32Rules) SetExample(v []uint32)
func (*Fixed32Rules) SetGt ¶
func (x *Fixed32Rules) SetGt(v uint32)
func (*Fixed32Rules) SetGte ¶
func (x *Fixed32Rules) SetGte(v uint32)
func (*Fixed32Rules) SetIn ¶
func (x *Fixed32Rules) SetIn(v []uint32)
func (*Fixed32Rules) SetLt ¶
func (x *Fixed32Rules) SetLt(v uint32)
func (*Fixed32Rules) SetLte ¶
func (x *Fixed32Rules) SetLte(v uint32)
func (*Fixed32Rules) SetNotIn ¶
func (x *Fixed32Rules) SetNotIn(v []uint32)
func (*Fixed32Rules) String ¶
func (x *Fixed32Rules) String() string
func (*Fixed32Rules) WhichGreaterThan ¶
func (x *Fixed32Rules) WhichGreaterThan() case_Fixed32Rules_GreaterThan
func (*Fixed32Rules) WhichLessThan ¶
func (x *Fixed32Rules) WhichLessThan() case_Fixed32Rules_LessThan
type Fixed32Rules_Gt ¶
type Fixed32Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be greater than 5 [fixed32.gt]
// fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];
//
// // must be greater than 5 and less than 10 [fixed32.gt_lt]
// fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]
// fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt uint32 `protobuf:"fixed32,4,opt,name=gt,oneof"`
}
type Fixed32Rules_Gte ¶
type Fixed32Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be greater than or equal to 5 [fixed32.gte]
// fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]
// fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]
// fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte uint32 `protobuf:"fixed32,5,opt,name=gte,oneof"`
}
type Fixed32Rules_Lt ¶
type Fixed32Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be less than 10
// fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];
// }
//
// “`
Lt uint32 `protobuf:"fixed32,2,opt,name=lt,oneof"`
}
type Fixed32Rules_Lte ¶
type Fixed32Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be less than or equal to 10
// fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];
// }
//
// “`
Lte uint32 `protobuf:"fixed32,3,opt,name=lte,oneof"`
}
type Fixed32Rules_builder ¶
type Fixed32Rules_builder struct {
// `const` requires the field value to exactly match the specified value.
// If the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // value must equal 42
// fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];
// }
//
// “`
Const *uint32
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be less than 10
// fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];
// }
//
// “`
Lt *uint32
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be less than or equal to 10
// fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];
// }
//
// “`
Lte *uint32
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be greater than 5 [fixed32.gt]
// fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];
//
// // must be greater than 5 and less than 10 [fixed32.gt_lt]
// fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]
// fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *uint32
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be greater than or equal to 5 [fixed32.gte]
// fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]
// fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]
// fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *uint32
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MyFixed32 {
// // must be in list [1, 2, 3]
// fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint32
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyFixed32 {
// // value must not be in list [1, 2, 3]
// fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint32
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFixed32 {
// fixed32 value = 1 [
// (buf.validate.field).fixed32.example = 1,
// (buf.validate.field).fixed32.example = 2
// ];
// }
//
// “`
Example []uint32
// contains filtered or unexported fields
}
func (Fixed32Rules_builder) Build ¶
func (b0 Fixed32Rules_builder) Build() *Fixed32Rules
type Fixed64Rules ¶
type Fixed64Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // value must equal 42
// fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];
// }
//
// “`
Const *uint64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *Fixed64Rules_Lt
// *Fixed64Rules_Lte
LessThan isFixed64Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *Fixed64Rules_Gt
// *Fixed64Rules_Gte
GreaterThan isFixed64Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyFixed64 {
// // must be in list [1, 2, 3]
// fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyFixed64 {
// // value must not be in list [1, 2, 3]
// fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFixed64 {
// fixed64 value = 1 [
// (buf.validate.field).fixed64.example = 1,
// (buf.validate.field).fixed64.example = 2
// ];
// }
//
// “`
Example []uint64 `protobuf:"fixed64,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
Fixed64Rules describes the rules applied to `fixed64` values.
func (*Fixed64Rules) ClearConst ¶
func (x *Fixed64Rules) ClearConst()
func (*Fixed64Rules) ClearGreaterThan ¶
func (x *Fixed64Rules) ClearGreaterThan()
func (*Fixed64Rules) ClearGt ¶
func (x *Fixed64Rules) ClearGt()
func (*Fixed64Rules) ClearGte ¶
func (x *Fixed64Rules) ClearGte()
func (*Fixed64Rules) ClearLessThan ¶
func (x *Fixed64Rules) ClearLessThan()
func (*Fixed64Rules) ClearLt ¶
func (x *Fixed64Rules) ClearLt()
func (*Fixed64Rules) ClearLte ¶
func (x *Fixed64Rules) ClearLte()
func (*Fixed64Rules) GetConst ¶
func (x *Fixed64Rules) GetConst() uint64
func (*Fixed64Rules) GetExample ¶
func (x *Fixed64Rules) GetExample() []uint64
func (*Fixed64Rules) GetGreaterThan ¶
func (x *Fixed64Rules) GetGreaterThan() isFixed64Rules_GreaterThan
func (*Fixed64Rules) GetGt ¶
func (x *Fixed64Rules) GetGt() uint64
func (*Fixed64Rules) GetGte ¶
func (x *Fixed64Rules) GetGte() uint64
func (*Fixed64Rules) GetIn ¶
func (x *Fixed64Rules) GetIn() []uint64
func (*Fixed64Rules) GetLessThan ¶
func (x *Fixed64Rules) GetLessThan() isFixed64Rules_LessThan
func (*Fixed64Rules) GetLt ¶
func (x *Fixed64Rules) GetLt() uint64
func (*Fixed64Rules) GetLte ¶
func (x *Fixed64Rules) GetLte() uint64
func (*Fixed64Rules) GetNotIn ¶
func (x *Fixed64Rules) GetNotIn() []uint64
func (*Fixed64Rules) HasConst ¶
func (x *Fixed64Rules) HasConst() bool
func (*Fixed64Rules) HasGreaterThan ¶
func (x *Fixed64Rules) HasGreaterThan() bool
func (*Fixed64Rules) HasGt ¶
func (x *Fixed64Rules) HasGt() bool
func (*Fixed64Rules) HasGte ¶
func (x *Fixed64Rules) HasGte() bool
func (*Fixed64Rules) HasLessThan ¶
func (x *Fixed64Rules) HasLessThan() bool
func (*Fixed64Rules) HasLt ¶
func (x *Fixed64Rules) HasLt() bool
func (*Fixed64Rules) HasLte ¶
func (x *Fixed64Rules) HasLte() bool
func (*Fixed64Rules) ProtoMessage ¶
func (*Fixed64Rules) ProtoMessage()
func (*Fixed64Rules) ProtoReflect ¶
func (x *Fixed64Rules) ProtoReflect() protoreflect.Message
func (*Fixed64Rules) Reset ¶
func (x *Fixed64Rules) Reset()
func (*Fixed64Rules) SetConst ¶
func (x *Fixed64Rules) SetConst(v uint64)
func (*Fixed64Rules) SetExample ¶
func (x *Fixed64Rules) SetExample(v []uint64)
func (*Fixed64Rules) SetGt ¶
func (x *Fixed64Rules) SetGt(v uint64)
func (*Fixed64Rules) SetGte ¶
func (x *Fixed64Rules) SetGte(v uint64)
func (*Fixed64Rules) SetIn ¶
func (x *Fixed64Rules) SetIn(v []uint64)
func (*Fixed64Rules) SetLt ¶
func (x *Fixed64Rules) SetLt(v uint64)
func (*Fixed64Rules) SetLte ¶
func (x *Fixed64Rules) SetLte(v uint64)
func (*Fixed64Rules) SetNotIn ¶
func (x *Fixed64Rules) SetNotIn(v []uint64)
func (*Fixed64Rules) String ¶
func (x *Fixed64Rules) String() string
func (*Fixed64Rules) WhichGreaterThan ¶
func (x *Fixed64Rules) WhichGreaterThan() case_Fixed64Rules_GreaterThan
func (*Fixed64Rules) WhichLessThan ¶
func (x *Fixed64Rules) WhichLessThan() case_Fixed64Rules_LessThan
type Fixed64Rules_Gt ¶
type Fixed64Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be greater than 5 [fixed64.gt]
// fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];
//
// // must be greater than 5 and less than 10 [fixed64.gt_lt]
// fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]
// fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt uint64 `protobuf:"fixed64,4,opt,name=gt,oneof"`
}
type Fixed64Rules_Gte ¶
type Fixed64Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be greater than or equal to 5 [fixed64.gte]
// fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]
// fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]
// fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte uint64 `protobuf:"fixed64,5,opt,name=gte,oneof"`
}
type Fixed64Rules_Lt ¶
type Fixed64Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be less than 10
// fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];
// }
//
// “`
Lt uint64 `protobuf:"fixed64,2,opt,name=lt,oneof"`
}
type Fixed64Rules_Lte ¶
type Fixed64Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be less than or equal to 10
// fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];
// }
//
// “`
Lte uint64 `protobuf:"fixed64,3,opt,name=lte,oneof"`
}
type Fixed64Rules_builder ¶
type Fixed64Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // value must equal 42
// fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];
// }
//
// “`
Const *uint64
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be less than 10
// fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];
// }
//
// “`
Lt *uint64
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be less than or equal to 10
// fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];
// }
//
// “`
Lte *uint64
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be greater than 5 [fixed64.gt]
// fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];
//
// // must be greater than 5 and less than 10 [fixed64.gt_lt]
// fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]
// fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *uint64
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFixed64 {
// // must be greater than or equal to 5 [fixed64.gte]
// fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]
// fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]
// fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *uint64
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyFixed64 {
// // must be in list [1, 2, 3]
// fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint64
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyFixed64 {
// // value must not be in list [1, 2, 3]
// fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint64
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFixed64 {
// fixed64 value = 1 [
// (buf.validate.field).fixed64.example = 1,
// (buf.validate.field).fixed64.example = 2
// ];
// }
//
// “`
Example []uint64
// contains filtered or unexported fields
}
func (Fixed64Rules_builder) Build ¶
func (b0 Fixed64Rules_builder) Build() *Fixed64Rules
type FloatRules ¶
type FloatRules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyFloat {
// // value must equal 42.0
// float value = 1 [(buf.validate.field).float.const = 42.0];
// }
//
// “`
Const *float32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *FloatRules_Lt
// *FloatRules_Lte
LessThan isFloatRules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *FloatRules_Gt
// *FloatRules_Gte
GreaterThan isFloatRules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MyFloat {
// // must be in list [1.0, 2.0, 3.0]
// float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];
// }
//
// “`
In []float32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyFloat {
// // value must not be in list [1.0, 2.0, 3.0]
// float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];
// }
//
// “`
NotIn []float32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `finite` requires the field value to be finite. If the field value is
// infinite or NaN, an error message is generated.
Finite *bool `protobuf:"varint,8,opt,name=finite" json:"finite,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFloat {
// float value = 1 [
// (buf.validate.field).float.example = 1.0,
// (buf.validate.field).float.example = inf
// ];
// }
//
// “`
Example []float32 `protobuf:"fixed32,9,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
FloatRules describes the rules applied to `float` values. These rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.
func (*FloatRules) ClearConst ¶
func (x *FloatRules) ClearConst()
func (*FloatRules) ClearFinite ¶
func (x *FloatRules) ClearFinite()
func (*FloatRules) ClearGreaterThan ¶
func (x *FloatRules) ClearGreaterThan()
func (*FloatRules) ClearGt ¶
func (x *FloatRules) ClearGt()
func (*FloatRules) ClearGte ¶
func (x *FloatRules) ClearGte()
func (*FloatRules) ClearLessThan ¶
func (x *FloatRules) ClearLessThan()
func (*FloatRules) ClearLt ¶
func (x *FloatRules) ClearLt()
func (*FloatRules) ClearLte ¶
func (x *FloatRules) ClearLte()
func (*FloatRules) GetConst ¶
func (x *FloatRules) GetConst() float32
func (*FloatRules) GetExample ¶
func (x *FloatRules) GetExample() []float32
func (*FloatRules) GetFinite ¶
func (x *FloatRules) GetFinite() bool
func (*FloatRules) GetGreaterThan ¶
func (x *FloatRules) GetGreaterThan() isFloatRules_GreaterThan
func (*FloatRules) GetGt ¶
func (x *FloatRules) GetGt() float32
func (*FloatRules) GetGte ¶
func (x *FloatRules) GetGte() float32
func (*FloatRules) GetIn ¶
func (x *FloatRules) GetIn() []float32
func (*FloatRules) GetLessThan ¶
func (x *FloatRules) GetLessThan() isFloatRules_LessThan
func (*FloatRules) GetLt ¶
func (x *FloatRules) GetLt() float32
func (*FloatRules) GetLte ¶
func (x *FloatRules) GetLte() float32
func (*FloatRules) GetNotIn ¶
func (x *FloatRules) GetNotIn() []float32
func (*FloatRules) HasConst ¶
func (x *FloatRules) HasConst() bool
func (*FloatRules) HasFinite ¶
func (x *FloatRules) HasFinite() bool
func (*FloatRules) HasGreaterThan ¶
func (x *FloatRules) HasGreaterThan() bool
func (*FloatRules) HasGt ¶
func (x *FloatRules) HasGt() bool
func (*FloatRules) HasGte ¶
func (x *FloatRules) HasGte() bool
func (*FloatRules) HasLessThan ¶
func (x *FloatRules) HasLessThan() bool
func (*FloatRules) HasLt ¶
func (x *FloatRules) HasLt() bool
func (*FloatRules) HasLte ¶
func (x *FloatRules) HasLte() bool
func (*FloatRules) ProtoMessage ¶
func (*FloatRules) ProtoMessage()
func (*FloatRules) ProtoReflect ¶
func (x *FloatRules) ProtoReflect() protoreflect.Message
func (*FloatRules) Reset ¶
func (x *FloatRules) Reset()
func (*FloatRules) SetConst ¶
func (x *FloatRules) SetConst(v float32)
func (*FloatRules) SetExample ¶
func (x *FloatRules) SetExample(v []float32)
func (*FloatRules) SetFinite ¶
func (x *FloatRules) SetFinite(v bool)
func (*FloatRules) SetGt ¶
func (x *FloatRules) SetGt(v float32)
func (*FloatRules) SetGte ¶
func (x *FloatRules) SetGte(v float32)
func (*FloatRules) SetIn ¶
func (x *FloatRules) SetIn(v []float32)
func (*FloatRules) SetLt ¶
func (x *FloatRules) SetLt(v float32)
func (*FloatRules) SetLte ¶
func (x *FloatRules) SetLte(v float32)
func (*FloatRules) SetNotIn ¶
func (x *FloatRules) SetNotIn(v []float32)
func (*FloatRules) String ¶
func (x *FloatRules) String() string
func (*FloatRules) WhichGreaterThan ¶
func (x *FloatRules) WhichGreaterThan() case_FloatRules_GreaterThan
func (*FloatRules) WhichLessThan ¶
func (x *FloatRules) WhichLessThan() case_FloatRules_LessThan
type FloatRules_Gt ¶
type FloatRules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be greater than 5.0 [float.gt]
// float value = 1 [(buf.validate.field).float.gt = 5.0];
//
// // must be greater than 5 and less than 10.0 [float.gt_lt]
// float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];
//
// // must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]
// float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];
// }
//
// “`
Gt float32 `protobuf:"fixed32,4,opt,name=gt,oneof"`
}
type FloatRules_Gte ¶
type FloatRules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be greater than or equal to 5.0 [float.gte]
// float value = 1 [(buf.validate.field).float.gte = 5.0];
//
// // must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]
// float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];
//
// // must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]
// float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];
// }
//
// “`
Gte float32 `protobuf:"fixed32,5,opt,name=gte,oneof"`
}
type FloatRules_Lt ¶
type FloatRules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be less than 10.0
// float value = 1 [(buf.validate.field).float.lt = 10.0];
// }
//
// “`
Lt float32 `protobuf:"fixed32,2,opt,name=lt,oneof"`
}
type FloatRules_Lte ¶
type FloatRules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be less than or equal to 10.0
// float value = 1 [(buf.validate.field).float.lte = 10.0];
// }
//
// “`
Lte float32 `protobuf:"fixed32,3,opt,name=lte,oneof"`
}
type FloatRules_builder ¶
type FloatRules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyFloat {
// // value must equal 42.0
// float value = 1 [(buf.validate.field).float.const = 42.0];
// }
//
// “`
Const *float32
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be less than 10.0
// float value = 1 [(buf.validate.field).float.lt = 10.0];
// }
//
// “`
Lt *float32
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be less than or equal to 10.0
// float value = 1 [(buf.validate.field).float.lte = 10.0];
// }
//
// “`
Lte *float32
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be greater than 5.0 [float.gt]
// float value = 1 [(buf.validate.field).float.gt = 5.0];
//
// // must be greater than 5 and less than 10.0 [float.gt_lt]
// float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];
//
// // must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]
// float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];
// }
//
// “`
Gt *float32
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyFloat {
// // must be greater than or equal to 5.0 [float.gte]
// float value = 1 [(buf.validate.field).float.gte = 5.0];
//
// // must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]
// float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];
//
// // must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]
// float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];
// }
//
// “`
Gte *float32
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MyFloat {
// // must be in list [1.0, 2.0, 3.0]
// float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];
// }
//
// “`
In []float32
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyFloat {
// // value must not be in list [1.0, 2.0, 3.0]
// float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];
// }
//
// “`
NotIn []float32
// `finite` requires the field value to be finite. If the field value is
// infinite or NaN, an error message is generated.
Finite *bool
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyFloat {
// float value = 1 [
// (buf.validate.field).float.example = 1.0,
// (buf.validate.field).float.example = inf
// ];
// }
//
// “`
Example []float32
// contains filtered or unexported fields
}
func (FloatRules_builder) Build ¶
func (b0 FloatRules_builder) Build() *FloatRules
type Ignore ¶
type Ignore int32
Specifies how `FieldRules.ignore` behaves, depending on the field's value, and whether the field tracks presence.
const ( // Ignore rules if the field tracks presence and is unset. This is the default // behavior. // // In proto3, only message fields, members of a Protobuf `oneof`, and fields // with the `optional` label track presence. Consequently, the following fields // are always validated, whether a value is set or not: // // “`proto // syntax="proto3"; // // message RulesApply { // string email = 1 [ // (buf.validate.field).string.email = true // ]; // int32 age = 2 [ // (buf.validate.field).int32.gt = 0 // ]; // repeated string labels = 3 [ // (buf.validate.field).repeated.min_items = 1 // ]; // } // // “` // // In contrast, the following fields track presence, and are only validated if // a value is set: // // “`proto // syntax="proto3"; // // message RulesApplyIfSet { // optional string email = 1 [ // (buf.validate.field).string.email = true // ]; // oneof ref { // string reference = 2 [ // (buf.validate.field).string.uuid = true // ]; // string name = 3 [ // (buf.validate.field).string.min_len = 4 // ]; // } // SomeMessage msg = 4 [ // (buf.validate.field).cel = {/* ... */} // ]; // } // // “` // // To ensure that such a field is set, add the `required` rule. // // To learn which fields track presence, see the // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). Ignore_IGNORE_UNSPECIFIED Ignore = 0 // Ignore rules if the field is unset, or set to the zero value. // // The zero value depends on the field type: // - For strings, the zero value is the empty string. // - For bytes, the zero value is empty bytes. // - For bool, the zero value is false. // - For numeric types, the zero value is zero. // - For enums, the zero value is the first defined enum value. // - For repeated fields, the zero is an empty list. // - For map fields, the zero is an empty map. // - For message fields, absence of the message (typically a null-value) is considered zero value. // // For fields that track presence (e.g. adding the `optional` label in proto3), // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`. Ignore_IGNORE_IF_ZERO_VALUE Ignore = 1 // Always ignore rules, including the `required` rule. // // This is useful for ignoring the rules of a referenced message, or to // temporarily ignore rules during development. // // “`proto // // message MyMessage { // // The field's rules will always be ignored, including any validations // // on value's fields. // MyOtherMessage value = 1 [ // (buf.validate.field).ignore = IGNORE_ALWAYS // ]; // } // // “` Ignore_IGNORE_ALWAYS Ignore = 3 )
func (Ignore) Descriptor ¶
func (Ignore) Descriptor() protoreflect.EnumDescriptor
func (Ignore) Number ¶
func (x Ignore) Number() protoreflect.EnumNumber
func (Ignore) Type ¶
func (Ignore) Type() protoreflect.EnumType
type Int32Rules ¶
type Int32Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // value must equal 42
// int32 value = 1 [(buf.validate.field).int32.const = 42];
// }
//
// “`
Const *int32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *Int32Rules_Lt
// *Int32Rules_Lte
LessThan isInt32Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *Int32Rules_Gt
// *Int32Rules_Gte
GreaterThan isInt32Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyInt32 {
// // must be in list [1, 2, 3]
// int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];
// }
//
// “`
In []int32 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MyInt32 {
// // value must not be in list [1, 2, 3]
// int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int32 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyInt32 {
// int32 value = 1 [
// (buf.validate.field).int32.example = 1,
// (buf.validate.field).int32.example = -10
// ];
// }
//
// “`
Example []int32 `protobuf:"varint,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
Int32Rules describes the rules applied to `int32` values. These rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.
func (*Int32Rules) ClearConst ¶
func (x *Int32Rules) ClearConst()
func (*Int32Rules) ClearGreaterThan ¶
func (x *Int32Rules) ClearGreaterThan()
func (*Int32Rules) ClearGt ¶
func (x *Int32Rules) ClearGt()
func (*Int32Rules) ClearGte ¶
func (x *Int32Rules) ClearGte()
func (*Int32Rules) ClearLessThan ¶
func (x *Int32Rules) ClearLessThan()
func (*Int32Rules) ClearLt ¶
func (x *Int32Rules) ClearLt()
func (*Int32Rules) ClearLte ¶
func (x *Int32Rules) ClearLte()
func (*Int32Rules) GetConst ¶
func (x *Int32Rules) GetConst() int32
func (*Int32Rules) GetExample ¶
func (x *Int32Rules) GetExample() []int32
func (*Int32Rules) GetGreaterThan ¶
func (x *Int32Rules) GetGreaterThan() isInt32Rules_GreaterThan
func (*Int32Rules) GetGt ¶
func (x *Int32Rules) GetGt() int32
func (*Int32Rules) GetGte ¶
func (x *Int32Rules) GetGte() int32
func (*Int32Rules) GetIn ¶
func (x *Int32Rules) GetIn() []int32
func (*Int32Rules) GetLessThan ¶
func (x *Int32Rules) GetLessThan() isInt32Rules_LessThan
func (*Int32Rules) GetLt ¶
func (x *Int32Rules) GetLt() int32
func (*Int32Rules) GetLte ¶
func (x *Int32Rules) GetLte() int32
func (*Int32Rules) GetNotIn ¶
func (x *Int32Rules) GetNotIn() []int32
func (*Int32Rules) HasConst ¶
func (x *Int32Rules) HasConst() bool
func (*Int32Rules) HasGreaterThan ¶
func (x *Int32Rules) HasGreaterThan() bool
func (*Int32Rules) HasGt ¶
func (x *Int32Rules) HasGt() bool
func (*Int32Rules) HasGte ¶
func (x *Int32Rules) HasGte() bool
func (*Int32Rules) HasLessThan ¶
func (x *Int32Rules) HasLessThan() bool
func (*Int32Rules) HasLt ¶
func (x *Int32Rules) HasLt() bool
func (*Int32Rules) HasLte ¶
func (x *Int32Rules) HasLte() bool
func (*Int32Rules) ProtoMessage ¶
func (*Int32Rules) ProtoMessage()
func (*Int32Rules) ProtoReflect ¶
func (x *Int32Rules) ProtoReflect() protoreflect.Message
func (*Int32Rules) Reset ¶
func (x *Int32Rules) Reset()
func (*Int32Rules) SetConst ¶
func (x *Int32Rules) SetConst(v int32)
func (*Int32Rules) SetExample ¶
func (x *Int32Rules) SetExample(v []int32)
func (*Int32Rules) SetGt ¶
func (x *Int32Rules) SetGt(v int32)
func (*Int32Rules) SetGte ¶
func (x *Int32Rules) SetGte(v int32)
func (*Int32Rules) SetIn ¶
func (x *Int32Rules) SetIn(v []int32)
func (*Int32Rules) SetLt ¶
func (x *Int32Rules) SetLt(v int32)
func (*Int32Rules) SetLte ¶
func (x *Int32Rules) SetLte(v int32)
func (*Int32Rules) SetNotIn ¶
func (x *Int32Rules) SetNotIn(v []int32)
func (*Int32Rules) String ¶
func (x *Int32Rules) String() string
func (*Int32Rules) WhichGreaterThan ¶
func (x *Int32Rules) WhichGreaterThan() case_Int32Rules_GreaterThan
func (*Int32Rules) WhichLessThan ¶
func (x *Int32Rules) WhichLessThan() case_Int32Rules_LessThan
type Int32Rules_Gt ¶
type Int32Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be greater than 5 [int32.gt]
// int32 value = 1 [(buf.validate.field).int32.gt = 5];
//
// // must be greater than 5 and less than 10 [int32.gt_lt]
// int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [int32.gt_lt_exclusive]
// int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt int32 `protobuf:"varint,4,opt,name=gt,oneof"`
}
type Int32Rules_Gte ¶
type Int32Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified value
// (exclusive). If the value of `gte` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be greater than or equal to 5 [int32.gte]
// int32 value = 1 [(buf.validate.field).int32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [int32.gte_lt]
// int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]
// int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte int32 `protobuf:"varint,5,opt,name=gte,oneof"`
}
type Int32Rules_Lt ¶
type Int32Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field
// < value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be less than 10
// int32 value = 1 [(buf.validate.field).int32.lt = 10];
// }
//
// “`
Lt int32 `protobuf:"varint,2,opt,name=lt,oneof"`
}
type Int32Rules_Lte ¶
type Int32Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be less than or equal to 10
// int32 value = 1 [(buf.validate.field).int32.lte = 10];
// }
//
// “`
Lte int32 `protobuf:"varint,3,opt,name=lte,oneof"`
}
type Int32Rules_builder ¶
type Int32Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // value must equal 42
// int32 value = 1 [(buf.validate.field).int32.const = 42];
// }
//
// “`
Const *int32
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field
// < value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be less than 10
// int32 value = 1 [(buf.validate.field).int32.lt = 10];
// }
//
// “`
Lt *int32
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be less than or equal to 10
// int32 value = 1 [(buf.validate.field).int32.lte = 10];
// }
//
// “`
Lte *int32
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be greater than 5 [int32.gt]
// int32 value = 1 [(buf.validate.field).int32.gt = 5];
//
// // must be greater than 5 and less than 10 [int32.gt_lt]
// int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [int32.gt_lt_exclusive]
// int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *int32
// `gte` requires the field value to be greater than or equal to the specified value
// (exclusive). If the value of `gte` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt32 {
// // must be greater than or equal to 5 [int32.gte]
// int32 value = 1 [(buf.validate.field).int32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [int32.gte_lt]
// int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]
// int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *int32
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyInt32 {
// // must be in list [1, 2, 3]
// int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];
// }
//
// “`
In []int32
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MyInt32 {
// // value must not be in list [1, 2, 3]
// int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int32
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyInt32 {
// int32 value = 1 [
// (buf.validate.field).int32.example = 1,
// (buf.validate.field).int32.example = -10
// ];
// }
//
// “`
Example []int32
// contains filtered or unexported fields
}
func (Int32Rules_builder) Build ¶
func (b0 Int32Rules_builder) Build() *Int32Rules
type Int64Rules ¶
type Int64Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // value must equal 42
// int64 value = 1 [(buf.validate.field).int64.const = 42];
// }
//
// “`
Const *int64 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *Int64Rules_Lt
// *Int64Rules_Lte
LessThan isInt64Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *Int64Rules_Gt
// *Int64Rules_Gte
GreaterThan isInt64Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyInt64 {
// // must be in list [1, 2, 3]
// int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];
// }
//
// “`
In []int64 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyInt64 {
// // value must not be in list [1, 2, 3]
// int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int64 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyInt64 {
// int64 value = 1 [
// (buf.validate.field).int64.example = 1,
// (buf.validate.field).int64.example = -10
// ];
// }
//
// “`
Example []int64 `protobuf:"varint,9,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
Int64Rules describes the rules applied to `int64` values. These rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.
func (*Int64Rules) ClearConst ¶
func (x *Int64Rules) ClearConst()
func (*Int64Rules) ClearGreaterThan ¶
func (x *Int64Rules) ClearGreaterThan()
func (*Int64Rules) ClearGt ¶
func (x *Int64Rules) ClearGt()
func (*Int64Rules) ClearGte ¶
func (x *Int64Rules) ClearGte()
func (*Int64Rules) ClearLessThan ¶
func (x *Int64Rules) ClearLessThan()
func (*Int64Rules) ClearLt ¶
func (x *Int64Rules) ClearLt()
func (*Int64Rules) ClearLte ¶
func (x *Int64Rules) ClearLte()
func (*Int64Rules) GetConst ¶
func (x *Int64Rules) GetConst() int64
func (*Int64Rules) GetExample ¶
func (x *Int64Rules) GetExample() []int64
func (*Int64Rules) GetGreaterThan ¶
func (x *Int64Rules) GetGreaterThan() isInt64Rules_GreaterThan
func (*Int64Rules) GetGt ¶
func (x *Int64Rules) GetGt() int64
func (*Int64Rules) GetGte ¶
func (x *Int64Rules) GetGte() int64
func (*Int64Rules) GetIn ¶
func (x *Int64Rules) GetIn() []int64
func (*Int64Rules) GetLessThan ¶
func (x *Int64Rules) GetLessThan() isInt64Rules_LessThan
func (*Int64Rules) GetLt ¶
func (x *Int64Rules) GetLt() int64
func (*Int64Rules) GetLte ¶
func (x *Int64Rules) GetLte() int64
func (*Int64Rules) GetNotIn ¶
func (x *Int64Rules) GetNotIn() []int64
func (*Int64Rules) HasConst ¶
func (x *Int64Rules) HasConst() bool
func (*Int64Rules) HasGreaterThan ¶
func (x *Int64Rules) HasGreaterThan() bool
func (*Int64Rules) HasGt ¶
func (x *Int64Rules) HasGt() bool
func (*Int64Rules) HasGte ¶
func (x *Int64Rules) HasGte() bool
func (*Int64Rules) HasLessThan ¶
func (x *Int64Rules) HasLessThan() bool
func (*Int64Rules) HasLt ¶
func (x *Int64Rules) HasLt() bool
func (*Int64Rules) HasLte ¶
func (x *Int64Rules) HasLte() bool
func (*Int64Rules) ProtoMessage ¶
func (*Int64Rules) ProtoMessage()
func (*Int64Rules) ProtoReflect ¶
func (x *Int64Rules) ProtoReflect() protoreflect.Message
func (*Int64Rules) Reset ¶
func (x *Int64Rules) Reset()
func (*Int64Rules) SetConst ¶
func (x *Int64Rules) SetConst(v int64)
func (*Int64Rules) SetExample ¶
func (x *Int64Rules) SetExample(v []int64)
func (*Int64Rules) SetGt ¶
func (x *Int64Rules) SetGt(v int64)
func (*Int64Rules) SetGte ¶
func (x *Int64Rules) SetGte(v int64)
func (*Int64Rules) SetIn ¶
func (x *Int64Rules) SetIn(v []int64)
func (*Int64Rules) SetLt ¶
func (x *Int64Rules) SetLt(v int64)
func (*Int64Rules) SetLte ¶
func (x *Int64Rules) SetLte(v int64)
func (*Int64Rules) SetNotIn ¶
func (x *Int64Rules) SetNotIn(v []int64)
func (*Int64Rules) String ¶
func (x *Int64Rules) String() string
func (*Int64Rules) WhichGreaterThan ¶
func (x *Int64Rules) WhichGreaterThan() case_Int64Rules_GreaterThan
func (*Int64Rules) WhichLessThan ¶
func (x *Int64Rules) WhichLessThan() case_Int64Rules_LessThan
type Int64Rules_Gt ¶
type Int64Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be greater than 5 [int64.gt]
// int64 value = 1 [(buf.validate.field).int64.gt = 5];
//
// // must be greater than 5 and less than 10 [int64.gt_lt]
// int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [int64.gt_lt_exclusive]
// int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt int64 `protobuf:"varint,4,opt,name=gt,oneof"`
}
type Int64Rules_Gte ¶
type Int64Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be greater than or equal to 5 [int64.gte]
// int64 value = 1 [(buf.validate.field).int64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [int64.gte_lt]
// int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]
// int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte int64 `protobuf:"varint,5,opt,name=gte,oneof"`
}
type Int64Rules_Lt ¶
type Int64Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be less than 10
// int64 value = 1 [(buf.validate.field).int64.lt = 10];
// }
//
// “`
Lt int64 `protobuf:"varint,2,opt,name=lt,oneof"`
}
type Int64Rules_Lte ¶
type Int64Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be less than or equal to 10
// int64 value = 1 [(buf.validate.field).int64.lte = 10];
// }
//
// “`
Lte int64 `protobuf:"varint,3,opt,name=lte,oneof"`
}
type Int64Rules_builder ¶
type Int64Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // value must equal 42
// int64 value = 1 [(buf.validate.field).int64.const = 42];
// }
//
// “`
Const *int64
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be less than 10
// int64 value = 1 [(buf.validate.field).int64.lt = 10];
// }
//
// “`
Lt *int64
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be less than or equal to 10
// int64 value = 1 [(buf.validate.field).int64.lte = 10];
// }
//
// “`
Lte *int64
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be greater than 5 [int64.gt]
// int64 value = 1 [(buf.validate.field).int64.gt = 5];
//
// // must be greater than 5 and less than 10 [int64.gt_lt]
// int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [int64.gt_lt_exclusive]
// int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *int64
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyInt64 {
// // must be greater than or equal to 5 [int64.gte]
// int64 value = 1 [(buf.validate.field).int64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [int64.gte_lt]
// int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]
// int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *int64
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyInt64 {
// // must be in list [1, 2, 3]
// int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];
// }
//
// “`
In []int64
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyInt64 {
// // value must not be in list [1, 2, 3]
// int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int64
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyInt64 {
// int64 value = 1 [
// (buf.validate.field).int64.example = 1,
// (buf.validate.field).int64.example = -10
// ];
// }
//
// “`
Example []int64
// contains filtered or unexported fields
}
func (Int64Rules_builder) Build ¶
func (b0 Int64Rules_builder) Build() *Int64Rules
type KnownRegex ¶
type KnownRegex int32
KnownRegex contains some well-known patterns.
const ( KnownRegex_KNOWN_REGEX_UNSPECIFIED KnownRegex = 0 // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2). KnownRegex_KNOWN_REGEX_HTTP_HEADER_NAME KnownRegex = 1 // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4). KnownRegex_KNOWN_REGEX_HTTP_HEADER_VALUE KnownRegex = 2 )
func (KnownRegex) Descriptor ¶
func (KnownRegex) Descriptor() protoreflect.EnumDescriptor
func (KnownRegex) Enum ¶
func (x KnownRegex) Enum() *KnownRegex
func (KnownRegex) Number ¶
func (x KnownRegex) Number() protoreflect.EnumNumber
func (KnownRegex) String ¶
func (x KnownRegex) String() string
func (KnownRegex) Type ¶
func (KnownRegex) Type() protoreflect.EnumType
type MapRules ¶
type MapRules struct {
// Specifies the minimum number of key-value pairs allowed. If the field has
// fewer key-value pairs than specified, an error message is generated.
//
// “`proto
//
// message MyMap {
// // The field `value` must have at least 2 key-value pairs.
// map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
// }
//
// “`
MinPairs *uint64 `protobuf:"varint,1,opt,name=min_pairs,json=minPairs" json:"min_pairs,omitempty"`
// Specifies the maximum number of key-value pairs allowed. If the field has
// more key-value pairs than specified, an error message is generated.
//
// “`proto
//
// message MyMap {
// // The field `value` must have at most 3 key-value pairs.
// map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
// }
//
// “`
MaxPairs *uint64 `protobuf:"varint,2,opt,name=max_pairs,json=maxPairs" json:"max_pairs,omitempty"`
// Specifies the rules to be applied to each key in the field.
//
// “`proto
//
// message MyMap {
// // The keys in the field `value` must follow the specified rules.
// map<string, string> value = 1 [(buf.validate.field).map.keys = {
// string: {
// min_len: 3
// max_len: 10
// }
// }];
// }
//
// “`
//
// Note that the `required` rule does not apply. Map keys cannot be unset.
Keys *FieldRules `protobuf:"bytes,4,opt,name=keys" json:"keys,omitempty"`
// Specifies the rules to be applied to the value of each key in the
// field. Message values will still have their validations evaluated unless
// `ignore` is specified.
//
// “`proto
//
// message MyMap {
// // The values in the field `value` must follow the specified rules.
// map<string, string> value = 1 [(buf.validate.field).map.values = {
// string: {
// min_len: 5
// max_len: 20
// }
// }];
// }
//
// “`
// Note that the `required` rule does not apply. Map values cannot be unset.
Values *FieldRules `protobuf:"bytes,5,opt,name=values" json:"values,omitempty"`
// contains filtered or unexported fields
}
MapRules describe the rules applied to `map` values.
func (*MapRules) GetKeys ¶
func (x *MapRules) GetKeys() *FieldRules
func (*MapRules) GetValues ¶
func (x *MapRules) GetValues() *FieldRules
func (*MapRules) ProtoReflect ¶
func (x *MapRules) ProtoReflect() protoreflect.Message
func (*MapRules) SetKeys ¶
func (x *MapRules) SetKeys(v *FieldRules)
func (*MapRules) SetValues ¶
func (x *MapRules) SetValues(v *FieldRules)
type MapRules_builder ¶
type MapRules_builder struct {
// Specifies the minimum number of key-value pairs allowed. If the field has
// fewer key-value pairs than specified, an error message is generated.
//
// “`proto
//
// message MyMap {
// // The field `value` must have at least 2 key-value pairs.
// map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
// }
//
// “`
MinPairs *uint64
// Specifies the maximum number of key-value pairs allowed. If the field has
// more key-value pairs than specified, an error message is generated.
//
// “`proto
//
// message MyMap {
// // The field `value` must have at most 3 key-value pairs.
// map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
// }
//
// “`
MaxPairs *uint64
// Specifies the rules to be applied to each key in the field.
//
// “`proto
//
// message MyMap {
// // The keys in the field `value` must follow the specified rules.
// map<string, string> value = 1 [(buf.validate.field).map.keys = {
// string: {
// min_len: 3
// max_len: 10
// }
// }];
// }
//
// “`
//
// Note that the `required` rule does not apply. Map keys cannot be unset.
Keys *FieldRules
// Specifies the rules to be applied to the value of each key in the
// field. Message values will still have their validations evaluated unless
// `ignore` is specified.
//
// “`proto
//
// message MyMap {
// // The values in the field `value` must follow the specified rules.
// map<string, string> value = 1 [(buf.validate.field).map.values = {
// string: {
// min_len: 5
// max_len: 20
// }
// }];
// }
//
// “`
// Note that the `required` rule does not apply. Map values cannot be unset.
Values *FieldRules
// contains filtered or unexported fields
}
func (MapRules_builder) Build ¶
func (b0 MapRules_builder) Build() *MapRules
type MessageOneofRule ¶
type MessageOneofRule struct {
// A list of field names to include in the oneof. All field names must be
// defined in the message. At least one field must be specified, and
// duplicates are not permitted.
Fields []string `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty"`
// If true, one of the fields specified _must_ be set.
Required *bool `protobuf:"varint,2,opt,name=required" json:"required,omitempty"`
// contains filtered or unexported fields
}
func (*MessageOneofRule) ClearRequired ¶
func (x *MessageOneofRule) ClearRequired()
func (*MessageOneofRule) GetFields ¶
func (x *MessageOneofRule) GetFields() []string
func (*MessageOneofRule) GetRequired ¶
func (x *MessageOneofRule) GetRequired() bool
func (*MessageOneofRule) HasRequired ¶
func (x *MessageOneofRule) HasRequired() bool
func (*MessageOneofRule) ProtoMessage ¶
func (*MessageOneofRule) ProtoMessage()
func (*MessageOneofRule) ProtoReflect ¶
func (x *MessageOneofRule) ProtoReflect() protoreflect.Message
func (*MessageOneofRule) Reset ¶
func (x *MessageOneofRule) Reset()
func (*MessageOneofRule) SetFields ¶
func (x *MessageOneofRule) SetFields(v []string)
func (*MessageOneofRule) SetRequired ¶
func (x *MessageOneofRule) SetRequired(v bool)
func (*MessageOneofRule) String ¶
func (x *MessageOneofRule) String() string
type MessageOneofRule_builder ¶
type MessageOneofRule_builder struct {
// A list of field names to include in the oneof. All field names must be
// defined in the message. At least one field must be specified, and
// duplicates are not permitted.
Fields []string
// If true, one of the fields specified _must_ be set.
Required *bool
// contains filtered or unexported fields
}
func (MessageOneofRule_builder) Build ¶
func (b0 MessageOneofRule_builder) Build() *MessageOneofRule
type MessageRules ¶
type MessageRules struct {
// `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation
// rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.
//
// This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for
// simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will
// be same as the `expression`.
//
// For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `foo` must be greater than 42.
// option (buf.validate.message).cel_expression = "this.foo > 42";
// // The field `foo` must be less than 84.
// option (buf.validate.message).cel_expression = "this.foo < 84";
// optional int32 foo = 1;
// }
//
// “`
CelExpression []string `protobuf:"bytes,5,rep,name=cel_expression,json=celExpression" json:"cel_expression,omitempty"`
// `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.
// These rules are written in Common Expression Language (CEL) syntax. For more information,
// [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `foo` must be greater than 42.
// option (buf.validate.message).cel = {
// id: "my_message.value",
// message: "must be greater than 42",
// expression: "this.foo > 42",
// };
// optional int32 foo = 1;
// }
//
// “`
Cel []*Rule `protobuf:"bytes,3,rep,name=cel" json:"cel,omitempty"`
// `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields
// of which at most one can be present. If `required` is also specified, then exactly one
// of the specified fields _must_ be present.
//
// This will enforce oneof-like constraints with a few features not provided by
// actual Protobuf oneof declarations:
// 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,
// only scalar fields are allowed.
// 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member
// fields have explicit presence. This means that, for the purpose of determining
// how many fields are set, explicitly setting such a field to its zero value is
// effectively the same as not setting it at all.
// 3. This will always generate validation errors for a message unmarshalled from
// serialized data that sets more than one field. With a Protobuf oneof, when
// multiple fields are present in the serialized form, earlier values are usually
// silently ignored when unmarshalling, with only the last field being set when
// unmarshalling completes.
//
// Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means
// only the field that is set will be validated and the unset fields are not validated according to the field rules.
// This behavior can be overridden by setting `ignore` against a field.
//
// “`proto
//
// message MyMessage {
// // Only one of `field1` or `field2` _can_ be present in this message.
// option (buf.validate.message).oneof = { fields: ["field1", "field2"] };
// // Exactly one of `field3` or `field4` _must_ be present in this message.
// option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true };
// string field1 = 1;
// bytes field2 = 2;
// bool field3 = 3;
// int32 field4 = 4;
// }
//
// “`
Oneof []*MessageOneofRule `protobuf:"bytes,4,rep,name=oneof" json:"oneof,omitempty"`
// contains filtered or unexported fields
}
MessageRules represents validation rules that are applied to the entire message. It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.
func (*MessageRules) GetCel ¶
func (x *MessageRules) GetCel() []*Rule
func (*MessageRules) GetCelExpression ¶
func (x *MessageRules) GetCelExpression() []string
func (*MessageRules) GetOneof ¶
func (x *MessageRules) GetOneof() []*MessageOneofRule
func (*MessageRules) ProtoMessage ¶
func (*MessageRules) ProtoMessage()
func (*MessageRules) ProtoReflect ¶
func (x *MessageRules) ProtoReflect() protoreflect.Message
func (*MessageRules) Reset ¶
func (x *MessageRules) Reset()
func (*MessageRules) SetCel ¶
func (x *MessageRules) SetCel(v []*Rule)
func (*MessageRules) SetCelExpression ¶
func (x *MessageRules) SetCelExpression(v []string)
func (*MessageRules) SetOneof ¶
func (x *MessageRules) SetOneof(v []*MessageOneofRule)
func (*MessageRules) String ¶
func (x *MessageRules) String() string
type MessageRules_builder ¶
type MessageRules_builder struct {
// `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation
// rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.
//
// This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for
// simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will
// be same as the `expression`.
//
// For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `foo` must be greater than 42.
// option (buf.validate.message).cel_expression = "this.foo > 42";
// // The field `foo` must be less than 84.
// option (buf.validate.message).cel_expression = "this.foo < 84";
// optional int32 foo = 1;
// }
//
// “`
CelExpression []string
// `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.
// These rules are written in Common Expression Language (CEL) syntax. For more information,
// [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `foo` must be greater than 42.
// option (buf.validate.message).cel = {
// id: "my_message.value",
// message: "must be greater than 42",
// expression: "this.foo > 42",
// };
// optional int32 foo = 1;
// }
//
// “`
Cel []*Rule
// `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields
// of which at most one can be present. If `required` is also specified, then exactly one
// of the specified fields _must_ be present.
//
// This will enforce oneof-like constraints with a few features not provided by
// actual Protobuf oneof declarations:
// 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,
// only scalar fields are allowed.
// 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member
// fields have explicit presence. This means that, for the purpose of determining
// how many fields are set, explicitly setting such a field to its zero value is
// effectively the same as not setting it at all.
// 3. This will always generate validation errors for a message unmarshalled from
// serialized data that sets more than one field. With a Protobuf oneof, when
// multiple fields are present in the serialized form, earlier values are usually
// silently ignored when unmarshalling, with only the last field being set when
// unmarshalling completes.
//
// Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means
// only the field that is set will be validated and the unset fields are not validated according to the field rules.
// This behavior can be overridden by setting `ignore` against a field.
//
// “`proto
//
// message MyMessage {
// // Only one of `field1` or `field2` _can_ be present in this message.
// option (buf.validate.message).oneof = { fields: ["field1", "field2"] };
// // Exactly one of `field3` or `field4` _must_ be present in this message.
// option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true };
// string field1 = 1;
// bytes field2 = 2;
// bool field3 = 3;
// int32 field4 = 4;
// }
//
// “`
Oneof []*MessageOneofRule
// contains filtered or unexported fields
}
func (MessageRules_builder) Build ¶
func (b0 MessageRules_builder) Build() *MessageRules
type OneofRules ¶
type OneofRules struct {
// If `required` is true, exactly one field of the oneof must be set. A
// validation error is returned if no fields in the oneof are set. Further rules
// should be placed on the fields themselves to ensure they are valid values,
// such as `min_len` or `gt`.
//
// “`proto
//
// message MyMessage {
// oneof value {
// // Either `a` or `b` must be set. If `a` is set, it must also be
// // non-empty; whereas if `b` is set, it can still be an empty string.
// option (buf.validate.oneof).required = true;
// string a = 1 [(buf.validate.field).string.min_len = 1];
// string b = 2;
// }
// }
//
// “`
Required *bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"`
// contains filtered or unexported fields
}
The `OneofRules` message type enables you to manage rules for oneof fields in your protobuf messages.
func (*OneofRules) ClearRequired ¶
func (x *OneofRules) ClearRequired()
func (*OneofRules) GetRequired ¶
func (x *OneofRules) GetRequired() bool
func (*OneofRules) HasRequired ¶
func (x *OneofRules) HasRequired() bool
func (*OneofRules) ProtoMessage ¶
func (*OneofRules) ProtoMessage()
func (*OneofRules) ProtoReflect ¶
func (x *OneofRules) ProtoReflect() protoreflect.Message
func (*OneofRules) Reset ¶
func (x *OneofRules) Reset()
func (*OneofRules) SetRequired ¶
func (x *OneofRules) SetRequired(v bool)
func (*OneofRules) String ¶
func (x *OneofRules) String() string
type OneofRules_builder ¶
type OneofRules_builder struct {
// If `required` is true, exactly one field of the oneof must be set. A
// validation error is returned if no fields in the oneof are set. Further rules
// should be placed on the fields themselves to ensure they are valid values,
// such as `min_len` or `gt`.
//
// “`proto
//
// message MyMessage {
// oneof value {
// // Either `a` or `b` must be set. If `a` is set, it must also be
// // non-empty; whereas if `b` is set, it can still be an empty string.
// option (buf.validate.oneof).required = true;
// string a = 1 [(buf.validate.field).string.min_len = 1];
// string b = 2;
// }
// }
//
// “`
Required *bool
// contains filtered or unexported fields
}
func (OneofRules_builder) Build ¶
func (b0 OneofRules_builder) Build() *OneofRules
type PredefinedRules ¶
type PredefinedRules struct {
// `cel` is a repeated field used to represent a textual expression
// in the Common Expression Language (CEL) syntax. For more information,
// [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `value` must be greater than 42.
// optional int32 value = 1 [(buf.validate.predefined).cel = {
// id: "my_message.value",
// message: "must be greater than 42",
// expression: "this > 42",
// }];
// }
//
// “`
Cel []*Rule `protobuf:"bytes,1,rep,name=cel" json:"cel,omitempty"`
// contains filtered or unexported fields
}
PredefinedRules are custom rules that can be re-used with multiple fields.
func (*PredefinedRules) GetCel ¶
func (x *PredefinedRules) GetCel() []*Rule
func (*PredefinedRules) ProtoMessage ¶
func (*PredefinedRules) ProtoMessage()
func (*PredefinedRules) ProtoReflect ¶
func (x *PredefinedRules) ProtoReflect() protoreflect.Message
func (*PredefinedRules) Reset ¶
func (x *PredefinedRules) Reset()
func (*PredefinedRules) SetCel ¶
func (x *PredefinedRules) SetCel(v []*Rule)
func (*PredefinedRules) String ¶
func (x *PredefinedRules) String() string
type PredefinedRules_builder ¶
type PredefinedRules_builder struct {
// `cel` is a repeated field used to represent a textual expression
// in the Common Expression Language (CEL) syntax. For more information,
// [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).
//
// “`proto
//
// message MyMessage {
// // The field `value` must be greater than 42.
// optional int32 value = 1 [(buf.validate.predefined).cel = {
// id: "my_message.value",
// message: "must be greater than 42",
// expression: "this > 42",
// }];
// }
//
// “`
Cel []*Rule
// contains filtered or unexported fields
}
func (PredefinedRules_builder) Build ¶
func (b0 PredefinedRules_builder) Build() *PredefinedRules
type RepeatedRules ¶
type RepeatedRules struct {
// `min_items` requires that this field must contain at least the specified
// minimum number of items.
//
// Note that `min_items = 1` is equivalent to setting a field as `required`.
//
// “`proto
//
// message MyRepeated {
// // value must contain at least 2 items
// repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
// }
//
// “`
MinItems *uint64 `protobuf:"varint,1,opt,name=min_items,json=minItems" json:"min_items,omitempty"`
// `max_items` denotes that this field must not exceed a
// certain number of items as the upper limit. If the field contains more
// items than specified, an error message will be generated, requiring the
// field to maintain no more than the specified number of items.
//
// “`proto
//
// message MyRepeated {
// // value must contain no more than 3 item(s)
// repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
// }
//
// “`
MaxItems *uint64 `protobuf:"varint,2,opt,name=max_items,json=maxItems" json:"max_items,omitempty"`
// `unique` indicates that all elements in this field must
// be unique. This rule is strictly applicable to scalar and enum
// types, with message types not being supported.
//
// “`proto
//
// message MyRepeated {
// // repeated value must contain unique items
// repeated string value = 1 [(buf.validate.field).repeated.unique = true];
// }
//
// “`
Unique *bool `protobuf:"varint,3,opt,name=unique" json:"unique,omitempty"`
// `items` details the rules to be applied to each item
// in the field. Even for repeated message fields, validation is executed
// against each item unless `ignore` is specified.
//
// “`proto
//
// message MyRepeated {
// // The items in the field `value` must follow the specified rules.
// repeated string value = 1 [(buf.validate.field).repeated.items = {
// string: {
// min_len: 3
// max_len: 10
// }
// }];
// }
//
// “`
//
// Note that the `required` rule does not apply. Repeated items
// cannot be unset.
Items *FieldRules `protobuf:"bytes,4,opt,name=items" json:"items,omitempty"`
// contains filtered or unexported fields
}
RepeatedRules describe the rules applied to `repeated` values.
func (*RepeatedRules) ClearItems ¶
func (x *RepeatedRules) ClearItems()
func (*RepeatedRules) ClearMaxItems ¶
func (x *RepeatedRules) ClearMaxItems()
func (*RepeatedRules) ClearMinItems ¶
func (x *RepeatedRules) ClearMinItems()
func (*RepeatedRules) ClearUnique ¶
func (x *RepeatedRules) ClearUnique()
func (*RepeatedRules) GetItems ¶
func (x *RepeatedRules) GetItems() *FieldRules
func (*RepeatedRules) GetMaxItems ¶
func (x *RepeatedRules) GetMaxItems() uint64
func (*RepeatedRules) GetMinItems ¶
func (x *RepeatedRules) GetMinItems() uint64
func (*RepeatedRules) GetUnique ¶
func (x *RepeatedRules) GetUnique() bool
func (*RepeatedRules) HasItems ¶
func (x *RepeatedRules) HasItems() bool
func (*RepeatedRules) HasMaxItems ¶
func (x *RepeatedRules) HasMaxItems() bool
func (*RepeatedRules) HasMinItems ¶
func (x *RepeatedRules) HasMinItems() bool
func (*RepeatedRules) HasUnique ¶
func (x *RepeatedRules) HasUnique() bool
func (*RepeatedRules) ProtoMessage ¶
func (*RepeatedRules) ProtoMessage()
func (*RepeatedRules) ProtoReflect ¶
func (x *RepeatedRules) ProtoReflect() protoreflect.Message
func (*RepeatedRules) Reset ¶
func (x *RepeatedRules) Reset()
func (*RepeatedRules) SetItems ¶
func (x *RepeatedRules) SetItems(v *FieldRules)
func (*RepeatedRules) SetMaxItems ¶
func (x *RepeatedRules) SetMaxItems(v uint64)
func (*RepeatedRules) SetMinItems ¶
func (x *RepeatedRules) SetMinItems(v uint64)
func (*RepeatedRules) SetUnique ¶
func (x *RepeatedRules) SetUnique(v bool)
func (*RepeatedRules) String ¶
func (x *RepeatedRules) String() string
type RepeatedRules_builder ¶
type RepeatedRules_builder struct {
// `min_items` requires that this field must contain at least the specified
// minimum number of items.
//
// Note that `min_items = 1` is equivalent to setting a field as `required`.
//
// “`proto
//
// message MyRepeated {
// // value must contain at least 2 items
// repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
// }
//
// “`
MinItems *uint64
// `max_items` denotes that this field must not exceed a
// certain number of items as the upper limit. If the field contains more
// items than specified, an error message will be generated, requiring the
// field to maintain no more than the specified number of items.
//
// “`proto
//
// message MyRepeated {
// // value must contain no more than 3 item(s)
// repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
// }
//
// “`
MaxItems *uint64
// `unique` indicates that all elements in this field must
// be unique. This rule is strictly applicable to scalar and enum
// types, with message types not being supported.
//
// “`proto
//
// message MyRepeated {
// // repeated value must contain unique items
// repeated string value = 1 [(buf.validate.field).repeated.unique = true];
// }
//
// “`
Unique *bool
// `items` details the rules to be applied to each item
// in the field. Even for repeated message fields, validation is executed
// against each item unless `ignore` is specified.
//
// “`proto
//
// message MyRepeated {
// // The items in the field `value` must follow the specified rules.
// repeated string value = 1 [(buf.validate.field).repeated.items = {
// string: {
// min_len: 3
// max_len: 10
// }
// }];
// }
//
// “`
//
// Note that the `required` rule does not apply. Repeated items
// cannot be unset.
Items *FieldRules
// contains filtered or unexported fields
}
func (RepeatedRules_builder) Build ¶
func (b0 RepeatedRules_builder) Build() *RepeatedRules
type Rule ¶
type Rule struct {
// `id` is a string that serves as a machine-readable name for this Rule.
// It should be unique within its scope, which could be either a message or a field.
Id *string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
// `message` is an optional field that provides a human-readable error message
// for this Rule when the CEL expression evaluates to false. If a
// non-empty message is provided, any strings resulting from the CEL
// expression evaluation are ignored.
Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
// `expression` is the actual CEL expression that will be evaluated for
// validation. This string must resolve to either a boolean or a string
// value. If the expression evaluates to false or a non-empty string, the
// validation is considered failed, and the message is rejected.
Expression *string `protobuf:"bytes,3,opt,name=expression" json:"expression,omitempty"`
// contains filtered or unexported fields
}
`Rule` represents a validation rule written in the Common Expression Language (CEL) syntax. Each Rule includes a unique identifier, an optional error message, and the CEL expression to evaluate. For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
```proto
message Foo {
option (buf.validate.message).cel = {
id: "foo.bar"
message: "bar must be greater than 0"
expression: "this.bar > 0"
};
int32 bar = 1;
}
```
func (*Rule) ProtoReflect ¶
func (x *Rule) ProtoReflect() protoreflect.Message
type Rule_builder ¶
type Rule_builder struct {
// `id` is a string that serves as a machine-readable name for this Rule.
// It should be unique within its scope, which could be either a message or a field.
Id *string
// `message` is an optional field that provides a human-readable error message
// for this Rule when the CEL expression evaluates to false. If a
// non-empty message is provided, any strings resulting from the CEL
// expression evaluation are ignored.
Message *string
// `expression` is the actual CEL expression that will be evaluated for
// validation. This string must resolve to either a boolean or a string
// value. If the expression evaluates to false or a non-empty string, the
// validation is considered failed, and the message is rejected.
Expression *string
// contains filtered or unexported fields
}
func (Rule_builder) Build ¶
func (b0 Rule_builder) Build() *Rule
type SFixed32Rules ¶
type SFixed32Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // value must equal 42
// sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];
// }
//
// “`
Const *int32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *SFixed32Rules_Lt
// *SFixed32Rules_Lte
LessThan isSFixed32Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *SFixed32Rules_Gt
// *SFixed32Rules_Gte
GreaterThan isSFixed32Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MySFixed32 {
// // must be in list [1, 2, 3]
// sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];
// }
//
// “`
In []int32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySFixed32 {
// // value must not be in list [1, 2, 3]
// sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySFixed32 {
// sfixed32 value = 1 [
// (buf.validate.field).sfixed32.example = 1,
// (buf.validate.field).sfixed32.example = 2
// ];
// }
//
// “`
Example []int32 `protobuf:"fixed32,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
SFixed32Rules describes the rules applied to `fixed32` values.
func (*SFixed32Rules) ClearConst ¶
func (x *SFixed32Rules) ClearConst()
func (*SFixed32Rules) ClearGreaterThan ¶
func (x *SFixed32Rules) ClearGreaterThan()
func (*SFixed32Rules) ClearGt ¶
func (x *SFixed32Rules) ClearGt()
func (*SFixed32Rules) ClearGte ¶
func (x *SFixed32Rules) ClearGte()
func (*SFixed32Rules) ClearLessThan ¶
func (x *SFixed32Rules) ClearLessThan()
func (*SFixed32Rules) ClearLt ¶
func (x *SFixed32Rules) ClearLt()
func (*SFixed32Rules) ClearLte ¶
func (x *SFixed32Rules) ClearLte()
func (*SFixed32Rules) GetConst ¶
func (x *SFixed32Rules) GetConst() int32
func (*SFixed32Rules) GetExample ¶
func (x *SFixed32Rules) GetExample() []int32
func (*SFixed32Rules) GetGreaterThan ¶
func (x *SFixed32Rules) GetGreaterThan() isSFixed32Rules_GreaterThan
func (*SFixed32Rules) GetGt ¶
func (x *SFixed32Rules) GetGt() int32
func (*SFixed32Rules) GetGte ¶
func (x *SFixed32Rules) GetGte() int32
func (*SFixed32Rules) GetIn ¶
func (x *SFixed32Rules) GetIn() []int32
func (*SFixed32Rules) GetLessThan ¶
func (x *SFixed32Rules) GetLessThan() isSFixed32Rules_LessThan
func (*SFixed32Rules) GetLt ¶
func (x *SFixed32Rules) GetLt() int32
func (*SFixed32Rules) GetLte ¶
func (x *SFixed32Rules) GetLte() int32
func (*SFixed32Rules) GetNotIn ¶
func (x *SFixed32Rules) GetNotIn() []int32
func (*SFixed32Rules) HasConst ¶
func (x *SFixed32Rules) HasConst() bool
func (*SFixed32Rules) HasGreaterThan ¶
func (x *SFixed32Rules) HasGreaterThan() bool
func (*SFixed32Rules) HasGt ¶
func (x *SFixed32Rules) HasGt() bool
func (*SFixed32Rules) HasGte ¶
func (x *SFixed32Rules) HasGte() bool
func (*SFixed32Rules) HasLessThan ¶
func (x *SFixed32Rules) HasLessThan() bool
func (*SFixed32Rules) HasLt ¶
func (x *SFixed32Rules) HasLt() bool
func (*SFixed32Rules) HasLte ¶
func (x *SFixed32Rules) HasLte() bool
func (*SFixed32Rules) ProtoMessage ¶
func (*SFixed32Rules) ProtoMessage()
func (*SFixed32Rules) ProtoReflect ¶
func (x *SFixed32Rules) ProtoReflect() protoreflect.Message
func (*SFixed32Rules) Reset ¶
func (x *SFixed32Rules) Reset()
func (*SFixed32Rules) SetConst ¶
func (x *SFixed32Rules) SetConst(v int32)
func (*SFixed32Rules) SetExample ¶
func (x *SFixed32Rules) SetExample(v []int32)
func (*SFixed32Rules) SetGt ¶
func (x *SFixed32Rules) SetGt(v int32)
func (*SFixed32Rules) SetGte ¶
func (x *SFixed32Rules) SetGte(v int32)
func (*SFixed32Rules) SetIn ¶
func (x *SFixed32Rules) SetIn(v []int32)
func (*SFixed32Rules) SetLt ¶
func (x *SFixed32Rules) SetLt(v int32)
func (*SFixed32Rules) SetLte ¶
func (x *SFixed32Rules) SetLte(v int32)
func (*SFixed32Rules) SetNotIn ¶
func (x *SFixed32Rules) SetNotIn(v []int32)
func (*SFixed32Rules) String ¶
func (x *SFixed32Rules) String() string
func (*SFixed32Rules) WhichGreaterThan ¶
func (x *SFixed32Rules) WhichGreaterThan() case_SFixed32Rules_GreaterThan
func (*SFixed32Rules) WhichLessThan ¶
func (x *SFixed32Rules) WhichLessThan() case_SFixed32Rules_LessThan
type SFixed32Rules_Gt ¶
type SFixed32Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be greater than 5 [sfixed32.gt]
// sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];
//
// // must be greater than 5 and less than 10 [sfixed32.gt_lt]
// sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]
// sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt int32 `protobuf:"fixed32,4,opt,name=gt,oneof"`
}
type SFixed32Rules_Gte ¶
type SFixed32Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be greater than or equal to 5 [sfixed32.gte]
// sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]
// sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]
// sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte int32 `protobuf:"fixed32,5,opt,name=gte,oneof"`
}
type SFixed32Rules_Lt ¶
type SFixed32Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be less than 10
// sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];
// }
//
// “`
Lt int32 `protobuf:"fixed32,2,opt,name=lt,oneof"`
}
type SFixed32Rules_Lte ¶
type SFixed32Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be less than or equal to 10
// sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];
// }
//
// “`
Lte int32 `protobuf:"fixed32,3,opt,name=lte,oneof"`
}
type SFixed32Rules_builder ¶
type SFixed32Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // value must equal 42
// sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];
// }
//
// “`
Const *int32
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be less than 10
// sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];
// }
//
// “`
Lt *int32
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be less than or equal to 10
// sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];
// }
//
// “`
Lte *int32
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be greater than 5 [sfixed32.gt]
// sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];
//
// // must be greater than 5 and less than 10 [sfixed32.gt_lt]
// sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]
// sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *int32
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed32 {
// // must be greater than or equal to 5 [sfixed32.gte]
// sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]
// sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]
// sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *int32
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MySFixed32 {
// // must be in list [1, 2, 3]
// sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];
// }
//
// “`
In []int32
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySFixed32 {
// // value must not be in list [1, 2, 3]
// sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int32
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySFixed32 {
// sfixed32 value = 1 [
// (buf.validate.field).sfixed32.example = 1,
// (buf.validate.field).sfixed32.example = 2
// ];
// }
//
// “`
Example []int32
// contains filtered or unexported fields
}
func (SFixed32Rules_builder) Build ¶
func (b0 SFixed32Rules_builder) Build() *SFixed32Rules
type SFixed64Rules ¶
type SFixed64Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // value must equal 42
// sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];
// }
//
// “`
Const *int64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *SFixed64Rules_Lt
// *SFixed64Rules_Lte
LessThan isSFixed64Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *SFixed64Rules_Gt
// *SFixed64Rules_Gte
GreaterThan isSFixed64Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MySFixed64 {
// // must be in list [1, 2, 3]
// sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];
// }
//
// “`
In []int64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySFixed64 {
// // value must not be in list [1, 2, 3]
// sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySFixed64 {
// sfixed64 value = 1 [
// (buf.validate.field).sfixed64.example = 1,
// (buf.validate.field).sfixed64.example = 2
// ];
// }
//
// “`
Example []int64 `protobuf:"fixed64,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
SFixed64Rules describes the rules applied to `fixed64` values.
func (*SFixed64Rules) ClearConst ¶
func (x *SFixed64Rules) ClearConst()
func (*SFixed64Rules) ClearGreaterThan ¶
func (x *SFixed64Rules) ClearGreaterThan()
func (*SFixed64Rules) ClearGt ¶
func (x *SFixed64Rules) ClearGt()
func (*SFixed64Rules) ClearGte ¶
func (x *SFixed64Rules) ClearGte()
func (*SFixed64Rules) ClearLessThan ¶
func (x *SFixed64Rules) ClearLessThan()
func (*SFixed64Rules) ClearLt ¶
func (x *SFixed64Rules) ClearLt()
func (*SFixed64Rules) ClearLte ¶
func (x *SFixed64Rules) ClearLte()
func (*SFixed64Rules) GetConst ¶
func (x *SFixed64Rules) GetConst() int64
func (*SFixed64Rules) GetExample ¶
func (x *SFixed64Rules) GetExample() []int64
func (*SFixed64Rules) GetGreaterThan ¶
func (x *SFixed64Rules) GetGreaterThan() isSFixed64Rules_GreaterThan
func (*SFixed64Rules) GetGt ¶
func (x *SFixed64Rules) GetGt() int64
func (*SFixed64Rules) GetGte ¶
func (x *SFixed64Rules) GetGte() int64
func (*SFixed64Rules) GetIn ¶
func (x *SFixed64Rules) GetIn() []int64
func (*SFixed64Rules) GetLessThan ¶
func (x *SFixed64Rules) GetLessThan() isSFixed64Rules_LessThan
func (*SFixed64Rules) GetLt ¶
func (x *SFixed64Rules) GetLt() int64
func (*SFixed64Rules) GetLte ¶
func (x *SFixed64Rules) GetLte() int64
func (*SFixed64Rules) GetNotIn ¶
func (x *SFixed64Rules) GetNotIn() []int64
func (*SFixed64Rules) HasConst ¶
func (x *SFixed64Rules) HasConst() bool
func (*SFixed64Rules) HasGreaterThan ¶
func (x *SFixed64Rules) HasGreaterThan() bool
func (*SFixed64Rules) HasGt ¶
func (x *SFixed64Rules) HasGt() bool
func (*SFixed64Rules) HasGte ¶
func (x *SFixed64Rules) HasGte() bool
func (*SFixed64Rules) HasLessThan ¶
func (x *SFixed64Rules) HasLessThan() bool
func (*SFixed64Rules) HasLt ¶
func (x *SFixed64Rules) HasLt() bool
func (*SFixed64Rules) HasLte ¶
func (x *SFixed64Rules) HasLte() bool
func (*SFixed64Rules) ProtoMessage ¶
func (*SFixed64Rules) ProtoMessage()
func (*SFixed64Rules) ProtoReflect ¶
func (x *SFixed64Rules) ProtoReflect() protoreflect.Message
func (*SFixed64Rules) Reset ¶
func (x *SFixed64Rules) Reset()
func (*SFixed64Rules) SetConst ¶
func (x *SFixed64Rules) SetConst(v int64)
func (*SFixed64Rules) SetExample ¶
func (x *SFixed64Rules) SetExample(v []int64)
func (*SFixed64Rules) SetGt ¶
func (x *SFixed64Rules) SetGt(v int64)
func (*SFixed64Rules) SetGte ¶
func (x *SFixed64Rules) SetGte(v int64)
func (*SFixed64Rules) SetIn ¶
func (x *SFixed64Rules) SetIn(v []int64)
func (*SFixed64Rules) SetLt ¶
func (x *SFixed64Rules) SetLt(v int64)
func (*SFixed64Rules) SetLte ¶
func (x *SFixed64Rules) SetLte(v int64)
func (*SFixed64Rules) SetNotIn ¶
func (x *SFixed64Rules) SetNotIn(v []int64)
func (*SFixed64Rules) String ¶
func (x *SFixed64Rules) String() string
func (*SFixed64Rules) WhichGreaterThan ¶
func (x *SFixed64Rules) WhichGreaterThan() case_SFixed64Rules_GreaterThan
func (*SFixed64Rules) WhichLessThan ¶
func (x *SFixed64Rules) WhichLessThan() case_SFixed64Rules_LessThan
type SFixed64Rules_Gt ¶
type SFixed64Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be greater than 5 [sfixed64.gt]
// sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];
//
// // must be greater than 5 and less than 10 [sfixed64.gt_lt]
// sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]
// sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt int64 `protobuf:"fixed64,4,opt,name=gt,oneof"`
}
type SFixed64Rules_Gte ¶
type SFixed64Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be greater than or equal to 5 [sfixed64.gte]
// sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]
// sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]
// sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte int64 `protobuf:"fixed64,5,opt,name=gte,oneof"`
}
type SFixed64Rules_Lt ¶
type SFixed64Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be less than 10
// sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];
// }
//
// “`
Lt int64 `protobuf:"fixed64,2,opt,name=lt,oneof"`
}
type SFixed64Rules_Lte ¶
type SFixed64Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be less than or equal to 10
// sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];
// }
//
// “`
Lte int64 `protobuf:"fixed64,3,opt,name=lte,oneof"`
}
type SFixed64Rules_builder ¶
type SFixed64Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // value must equal 42
// sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];
// }
//
// “`
Const *int64
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be less than 10
// sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];
// }
//
// “`
Lt *int64
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be less than or equal to 10
// sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];
// }
//
// “`
Lte *int64
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be greater than 5 [sfixed64.gt]
// sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];
//
// // must be greater than 5 and less than 10 [sfixed64.gt_lt]
// sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]
// sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *int64
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySFixed64 {
// // must be greater than or equal to 5 [sfixed64.gte]
// sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]
// sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]
// sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *int64
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MySFixed64 {
// // must be in list [1, 2, 3]
// sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];
// }
//
// “`
In []int64
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySFixed64 {
// // value must not be in list [1, 2, 3]
// sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int64
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySFixed64 {
// sfixed64 value = 1 [
// (buf.validate.field).sfixed64.example = 1,
// (buf.validate.field).sfixed64.example = 2
// ];
// }
//
// “`
Example []int64
// contains filtered or unexported fields
}
func (SFixed64Rules_builder) Build ¶
func (b0 SFixed64Rules_builder) Build() *SFixed64Rules
type SInt32Rules ¶
type SInt32Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // value must equal 42
// sint32 value = 1 [(buf.validate.field).sint32.const = 42];
// }
//
// “`
Const *int32 `protobuf:"zigzag32,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *SInt32Rules_Lt
// *SInt32Rules_Lte
LessThan isSInt32Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *SInt32Rules_Gt
// *SInt32Rules_Gte
GreaterThan isSInt32Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MySInt32 {
// // must be in list [1, 2, 3]
// sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];
// }
//
// “`
In []int32 `protobuf:"zigzag32,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySInt32 {
// // value must not be in list [1, 2, 3]
// sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int32 `protobuf:"zigzag32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySInt32 {
// sint32 value = 1 [
// (buf.validate.field).sint32.example = 1,
// (buf.validate.field).sint32.example = -10
// ];
// }
//
// “`
Example []int32 `protobuf:"zigzag32,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
SInt32Rules describes the rules applied to `sint32` values.
func (*SInt32Rules) ClearConst ¶
func (x *SInt32Rules) ClearConst()
func (*SInt32Rules) ClearGreaterThan ¶
func (x *SInt32Rules) ClearGreaterThan()
func (*SInt32Rules) ClearGt ¶
func (x *SInt32Rules) ClearGt()
func (*SInt32Rules) ClearGte ¶
func (x *SInt32Rules) ClearGte()
func (*SInt32Rules) ClearLessThan ¶
func (x *SInt32Rules) ClearLessThan()
func (*SInt32Rules) ClearLt ¶
func (x *SInt32Rules) ClearLt()
func (*SInt32Rules) ClearLte ¶
func (x *SInt32Rules) ClearLte()
func (*SInt32Rules) GetConst ¶
func (x *SInt32Rules) GetConst() int32
func (*SInt32Rules) GetExample ¶
func (x *SInt32Rules) GetExample() []int32
func (*SInt32Rules) GetGreaterThan ¶
func (x *SInt32Rules) GetGreaterThan() isSInt32Rules_GreaterThan
func (*SInt32Rules) GetGt ¶
func (x *SInt32Rules) GetGt() int32
func (*SInt32Rules) GetGte ¶
func (x *SInt32Rules) GetGte() int32
func (*SInt32Rules) GetIn ¶
func (x *SInt32Rules) GetIn() []int32
func (*SInt32Rules) GetLessThan ¶
func (x *SInt32Rules) GetLessThan() isSInt32Rules_LessThan
func (*SInt32Rules) GetLt ¶
func (x *SInt32Rules) GetLt() int32
func (*SInt32Rules) GetLte ¶
func (x *SInt32Rules) GetLte() int32
func (*SInt32Rules) GetNotIn ¶
func (x *SInt32Rules) GetNotIn() []int32
func (*SInt32Rules) HasConst ¶
func (x *SInt32Rules) HasConst() bool
func (*SInt32Rules) HasGreaterThan ¶
func (x *SInt32Rules) HasGreaterThan() bool
func (*SInt32Rules) HasGt ¶
func (x *SInt32Rules) HasGt() bool
func (*SInt32Rules) HasGte ¶
func (x *SInt32Rules) HasGte() bool
func (*SInt32Rules) HasLessThan ¶
func (x *SInt32Rules) HasLessThan() bool
func (*SInt32Rules) HasLt ¶
func (x *SInt32Rules) HasLt() bool
func (*SInt32Rules) HasLte ¶
func (x *SInt32Rules) HasLte() bool
func (*SInt32Rules) ProtoMessage ¶
func (*SInt32Rules) ProtoMessage()
func (*SInt32Rules) ProtoReflect ¶
func (x *SInt32Rules) ProtoReflect() protoreflect.Message
func (*SInt32Rules) Reset ¶
func (x *SInt32Rules) Reset()
func (*SInt32Rules) SetConst ¶
func (x *SInt32Rules) SetConst(v int32)
func (*SInt32Rules) SetExample ¶
func (x *SInt32Rules) SetExample(v []int32)
func (*SInt32Rules) SetGt ¶
func (x *SInt32Rules) SetGt(v int32)
func (*SInt32Rules) SetGte ¶
func (x *SInt32Rules) SetGte(v int32)
func (*SInt32Rules) SetIn ¶
func (x *SInt32Rules) SetIn(v []int32)
func (*SInt32Rules) SetLt ¶
func (x *SInt32Rules) SetLt(v int32)
func (*SInt32Rules) SetLte ¶
func (x *SInt32Rules) SetLte(v int32)
func (*SInt32Rules) SetNotIn ¶
func (x *SInt32Rules) SetNotIn(v []int32)
func (*SInt32Rules) String ¶
func (x *SInt32Rules) String() string
func (*SInt32Rules) WhichGreaterThan ¶
func (x *SInt32Rules) WhichGreaterThan() case_SInt32Rules_GreaterThan
func (*SInt32Rules) WhichLessThan ¶
func (x *SInt32Rules) WhichLessThan() case_SInt32Rules_LessThan
type SInt32Rules_Gt ¶
type SInt32Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be greater than 5 [sint32.gt]
// sint32 value = 1 [(buf.validate.field).sint32.gt = 5];
//
// // must be greater than 5 and less than 10 [sint32.gt_lt]
// sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]
// sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt int32 `protobuf:"zigzag32,4,opt,name=gt,oneof"`
}
type SInt32Rules_Gte ¶
type SInt32Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be greater than or equal to 5 [sint32.gte]
// sint32 value = 1 [(buf.validate.field).sint32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sint32.gte_lt]
// sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]
// sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte int32 `protobuf:"zigzag32,5,opt,name=gte,oneof"`
}
type SInt32Rules_Lt ¶
type SInt32Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field
// < value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be less than 10
// sint32 value = 1 [(buf.validate.field).sint32.lt = 10];
// }
//
// “`
Lt int32 `protobuf:"zigzag32,2,opt,name=lt,oneof"`
}
type SInt32Rules_Lte ¶
type SInt32Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be less than or equal to 10
// sint32 value = 1 [(buf.validate.field).sint32.lte = 10];
// }
//
// “`
Lte int32 `protobuf:"zigzag32,3,opt,name=lte,oneof"`
}
type SInt32Rules_builder ¶
type SInt32Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // value must equal 42
// sint32 value = 1 [(buf.validate.field).sint32.const = 42];
// }
//
// “`
Const *int32
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field
// < value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be less than 10
// sint32 value = 1 [(buf.validate.field).sint32.lt = 10];
// }
//
// “`
Lt *int32
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be less than or equal to 10
// sint32 value = 1 [(buf.validate.field).sint32.lte = 10];
// }
//
// “`
Lte *int32
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be greater than 5 [sint32.gt]
// sint32 value = 1 [(buf.validate.field).sint32.gt = 5];
//
// // must be greater than 5 and less than 10 [sint32.gt_lt]
// sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]
// sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *int32
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt32 {
// // must be greater than or equal to 5 [sint32.gte]
// sint32 value = 1 [(buf.validate.field).sint32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sint32.gte_lt]
// sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]
// sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *int32
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MySInt32 {
// // must be in list [1, 2, 3]
// sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];
// }
//
// “`
In []int32
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySInt32 {
// // value must not be in list [1, 2, 3]
// sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int32
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySInt32 {
// sint32 value = 1 [
// (buf.validate.field).sint32.example = 1,
// (buf.validate.field).sint32.example = -10
// ];
// }
//
// “`
Example []int32
// contains filtered or unexported fields
}
func (SInt32Rules_builder) Build ¶
func (b0 SInt32Rules_builder) Build() *SInt32Rules
type SInt64Rules ¶
type SInt64Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // value must equal 42
// sint64 value = 1 [(buf.validate.field).sint64.const = 42];
// }
//
// “`
Const *int64 `protobuf:"zigzag64,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *SInt64Rules_Lt
// *SInt64Rules_Lte
LessThan isSInt64Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *SInt64Rules_Gt
// *SInt64Rules_Gte
GreaterThan isSInt64Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MySInt64 {
// // must be in list [1, 2, 3]
// sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];
// }
//
// “`
In []int64 `protobuf:"zigzag64,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySInt64 {
// // value must not be in list [1, 2, 3]
// sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int64 `protobuf:"zigzag64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySInt64 {
// sint64 value = 1 [
// (buf.validate.field).sint64.example = 1,
// (buf.validate.field).sint64.example = -10
// ];
// }
//
// “`
Example []int64 `protobuf:"zigzag64,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
SInt64Rules describes the rules applied to `sint64` values.
func (*SInt64Rules) ClearConst ¶
func (x *SInt64Rules) ClearConst()
func (*SInt64Rules) ClearGreaterThan ¶
func (x *SInt64Rules) ClearGreaterThan()
func (*SInt64Rules) ClearGt ¶
func (x *SInt64Rules) ClearGt()
func (*SInt64Rules) ClearGte ¶
func (x *SInt64Rules) ClearGte()
func (*SInt64Rules) ClearLessThan ¶
func (x *SInt64Rules) ClearLessThan()
func (*SInt64Rules) ClearLt ¶
func (x *SInt64Rules) ClearLt()
func (*SInt64Rules) ClearLte ¶
func (x *SInt64Rules) ClearLte()
func (*SInt64Rules) GetConst ¶
func (x *SInt64Rules) GetConst() int64
func (*SInt64Rules) GetExample ¶
func (x *SInt64Rules) GetExample() []int64
func (*SInt64Rules) GetGreaterThan ¶
func (x *SInt64Rules) GetGreaterThan() isSInt64Rules_GreaterThan
func (*SInt64Rules) GetGt ¶
func (x *SInt64Rules) GetGt() int64
func (*SInt64Rules) GetGte ¶
func (x *SInt64Rules) GetGte() int64
func (*SInt64Rules) GetIn ¶
func (x *SInt64Rules) GetIn() []int64
func (*SInt64Rules) GetLessThan ¶
func (x *SInt64Rules) GetLessThan() isSInt64Rules_LessThan
func (*SInt64Rules) GetLt ¶
func (x *SInt64Rules) GetLt() int64
func (*SInt64Rules) GetLte ¶
func (x *SInt64Rules) GetLte() int64
func (*SInt64Rules) GetNotIn ¶
func (x *SInt64Rules) GetNotIn() []int64
func (*SInt64Rules) HasConst ¶
func (x *SInt64Rules) HasConst() bool
func (*SInt64Rules) HasGreaterThan ¶
func (x *SInt64Rules) HasGreaterThan() bool
func (*SInt64Rules) HasGt ¶
func (x *SInt64Rules) HasGt() bool
func (*SInt64Rules) HasGte ¶
func (x *SInt64Rules) HasGte() bool
func (*SInt64Rules) HasLessThan ¶
func (x *SInt64Rules) HasLessThan() bool
func (*SInt64Rules) HasLt ¶
func (x *SInt64Rules) HasLt() bool
func (*SInt64Rules) HasLte ¶
func (x *SInt64Rules) HasLte() bool
func (*SInt64Rules) ProtoMessage ¶
func (*SInt64Rules) ProtoMessage()
func (*SInt64Rules) ProtoReflect ¶
func (x *SInt64Rules) ProtoReflect() protoreflect.Message
func (*SInt64Rules) Reset ¶
func (x *SInt64Rules) Reset()
func (*SInt64Rules) SetConst ¶
func (x *SInt64Rules) SetConst(v int64)
func (*SInt64Rules) SetExample ¶
func (x *SInt64Rules) SetExample(v []int64)
func (*SInt64Rules) SetGt ¶
func (x *SInt64Rules) SetGt(v int64)
func (*SInt64Rules) SetGte ¶
func (x *SInt64Rules) SetGte(v int64)
func (*SInt64Rules) SetIn ¶
func (x *SInt64Rules) SetIn(v []int64)
func (*SInt64Rules) SetLt ¶
func (x *SInt64Rules) SetLt(v int64)
func (*SInt64Rules) SetLte ¶
func (x *SInt64Rules) SetLte(v int64)
func (*SInt64Rules) SetNotIn ¶
func (x *SInt64Rules) SetNotIn(v []int64)
func (*SInt64Rules) String ¶
func (x *SInt64Rules) String() string
func (*SInt64Rules) WhichGreaterThan ¶
func (x *SInt64Rules) WhichGreaterThan() case_SInt64Rules_GreaterThan
func (*SInt64Rules) WhichLessThan ¶
func (x *SInt64Rules) WhichLessThan() case_SInt64Rules_LessThan
type SInt64Rules_Gt ¶
type SInt64Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be greater than 5 [sint64.gt]
// sint64 value = 1 [(buf.validate.field).sint64.gt = 5];
//
// // must be greater than 5 and less than 10 [sint64.gt_lt]
// sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]
// sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt int64 `protobuf:"zigzag64,4,opt,name=gt,oneof"`
}
type SInt64Rules_Gte ¶
type SInt64Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be greater than or equal to 5 [sint64.gte]
// sint64 value = 1 [(buf.validate.field).sint64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sint64.gte_lt]
// sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]
// sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte int64 `protobuf:"zigzag64,5,opt,name=gte,oneof"`
}
type SInt64Rules_Lt ¶
type SInt64Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field
// < value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be less than 10
// sint64 value = 1 [(buf.validate.field).sint64.lt = 10];
// }
//
// “`
Lt int64 `protobuf:"zigzag64,2,opt,name=lt,oneof"`
}
type SInt64Rules_Lte ¶
type SInt64Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be less than or equal to 10
// sint64 value = 1 [(buf.validate.field).sint64.lte = 10];
// }
//
// “`
Lte int64 `protobuf:"zigzag64,3,opt,name=lte,oneof"`
}
type SInt64Rules_builder ¶
type SInt64Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // value must equal 42
// sint64 value = 1 [(buf.validate.field).sint64.const = 42];
// }
//
// “`
Const *int64
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field
// < value). If the field value is equal to or greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be less than 10
// sint64 value = 1 [(buf.validate.field).sint64.lt = 10];
// }
//
// “`
Lt *int64
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be less than or equal to 10
// sint64 value = 1 [(buf.validate.field).sint64.lte = 10];
// }
//
// “`
Lte *int64
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be greater than 5 [sint64.gt]
// sint64 value = 1 [(buf.validate.field).sint64.gt = 5];
//
// // must be greater than 5 and less than 10 [sint64.gt_lt]
// sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]
// sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *int64
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MySInt64 {
// // must be greater than or equal to 5 [sint64.gte]
// sint64 value = 1 [(buf.validate.field).sint64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [sint64.gte_lt]
// sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]
// sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *int64
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message
// is generated.
//
// “`proto
//
// message MySInt64 {
// // must be in list [1, 2, 3]
// sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];
// }
//
// “`
In []int64
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MySInt64 {
// // value must not be in list [1, 2, 3]
// sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []int64
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MySInt64 {
// sint64 value = 1 [
// (buf.validate.field).sint64.example = 1,
// (buf.validate.field).sint64.example = -10
// ];
// }
//
// “`
Example []int64
// contains filtered or unexported fields
}
func (SInt64Rules_builder) Build ¶
func (b0 SInt64Rules_builder) Build() *SInt64Rules
type StringRules ¶
type StringRules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyString {
// // value must equal `hello`
// string value = 1 [(buf.validate.field).string.const = "hello"];
// }
//
// “`
Const *string `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"`
// `len` dictates that the field value must have the specified
// number of characters (Unicode code points), which may differ from the number
// of bytes in the string. If the field value does not meet the specified
// length, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be 5 characters
// string value = 1 [(buf.validate.field).string.len = 5];
// }
//
// “`
Len *uint64 `protobuf:"varint,19,opt,name=len" json:"len,omitempty"`
// `min_len` specifies that the field value must have at least the specified
// number of characters (Unicode code points), which may differ from the number
// of bytes in the string. If the field value contains fewer characters, an error
// message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at least 3 characters
// string value = 1 [(buf.validate.field).string.min_len = 3];
// }
//
// “`
MinLen *uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen" json:"min_len,omitempty"`
// `max_len` specifies that the field value must have no more than the specified
// number of characters (Unicode code points), which may differ from the
// number of bytes in the string. If the field value contains more characters,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at most 10 characters
// string value = 1 [(buf.validate.field).string.max_len = 10];
// }
//
// “`
MaxLen *uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen" json:"max_len,omitempty"`
// `len_bytes` dictates that the field value must have the specified number of
// bytes. If the field value does not match the specified length in bytes,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be 6 bytes
// string value = 1 [(buf.validate.field).string.len_bytes = 6];
// }
//
// “`
LenBytes *uint64 `protobuf:"varint,20,opt,name=len_bytes,json=lenBytes" json:"len_bytes,omitempty"`
// `min_bytes` specifies that the field value must have at least the specified
// number of bytes. If the field value contains fewer bytes, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at least 4 bytes
// string value = 1 [(buf.validate.field).string.min_bytes = 4];
// }
//
// “`
MinBytes *uint64 `protobuf:"varint,4,opt,name=min_bytes,json=minBytes" json:"min_bytes,omitempty"`
// `max_bytes` specifies that the field value must have no more than the
// specified number of bytes. If the field value contains more bytes, an
// error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at most 8 bytes
// string value = 1 [(buf.validate.field).string.max_bytes = 8];
// }
//
// “`
MaxBytes *uint64 `protobuf:"varint,5,opt,name=max_bytes,json=maxBytes" json:"max_bytes,omitempty"`
// `pattern` specifies that the field value must match the specified
// regular expression (RE2 syntax), with the expression provided without any
// delimiters. If the field value doesn't match the regular expression, an
// error message will be generated.
//
// “`proto
//
// message MyString {
// // value does not match regex pattern `^[a-zA-Z]//$`
// string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
// }
//
// “`
Pattern *string `protobuf:"bytes,6,opt,name=pattern" json:"pattern,omitempty"`
// `prefix` specifies that the field value must have the
// specified substring at the beginning of the string. If the field value
// doesn't start with the specified prefix, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // value does not have prefix `pre`
// string value = 1 [(buf.validate.field).string.prefix = "pre"];
// }
//
// “`
Prefix *string `protobuf:"bytes,7,opt,name=prefix" json:"prefix,omitempty"`
// `suffix` specifies that the field value must have the
// specified substring at the end of the string. If the field value doesn't
// end with the specified suffix, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value does not have suffix `post`
// string value = 1 [(buf.validate.field).string.suffix = "post"];
// }
//
// “`
Suffix *string `protobuf:"bytes,8,opt,name=suffix" json:"suffix,omitempty"`
// `contains` specifies that the field value must have the
// specified substring anywhere in the string. If the field value doesn't
// contain the specified substring, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value does not contain substring `inside`.
// string value = 1 [(buf.validate.field).string.contains = "inside"];
// }
//
// “`
Contains *string `protobuf:"bytes,9,opt,name=contains" json:"contains,omitempty"`
// `not_contains` specifies that the field value must not have the
// specified substring anywhere in the string. If the field value contains
// the specified substring, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value contains substring `inside`.
// string value = 1 [(buf.validate.field).string.not_contains = "inside"];
// }
//
// “`
NotContains *string `protobuf:"bytes,23,opt,name=not_contains,json=notContains" json:"not_contains,omitempty"`
// `in` specifies that the field value must be equal to one of the specified
// values. If the field value isn't one of the specified values, an error
// message will be generated.
//
// “`proto
//
// message MyString {
// // must be in list ["apple", "banana"]
// string value = 1 [(buf.validate.field).string = { in: ["apple", "banana"] }];
// }
//
// “`
In []string `protobuf:"bytes,10,rep,name=in" json:"in,omitempty"`
// `not_in` specifies that the field value cannot be equal to any
// of the specified values. If the field value is one of the specified values,
// an error message will be generated.
// “`proto
//
// message MyString {
// // value must not be in list ["orange", "grape"]
// string value = 1 [(buf.validate.field).string = { not_in: ["orange", "grape"] }];
// }
//
// “`
NotIn []string `protobuf:"bytes,11,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `WellKnown` rules provide advanced rules against common string
// patterns.
//
// Types that are valid to be assigned to WellKnown:
//
// *StringRules_Email
// *StringRules_Hostname
// *StringRules_Ip
// *StringRules_Ipv4
// *StringRules_Ipv6
// *StringRules_Uri
// *StringRules_UriRef
// *StringRules_Address
// *StringRules_Uuid
// *StringRules_Tuuid
// *StringRules_IpWithPrefixlen
// *StringRules_Ipv4WithPrefixlen
// *StringRules_Ipv6WithPrefixlen
// *StringRules_IpPrefix
// *StringRules_Ipv4Prefix
// *StringRules_Ipv6Prefix
// *StringRules_HostAndPort
// *StringRules_Ulid
// *StringRules_ProtobufFqn
// *StringRules_ProtobufDotFqn
// *StringRules_WellKnownRegex
WellKnown isStringRules_WellKnown `protobuf_oneof:"well_known"`
// This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
// enable strict header validation. By default, this is true, and HTTP header
// validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser
// validations that only disallow `\r\n\0` characters, which can be used to
// bypass header matching rules.
//
// “`proto
//
// message MyString {
// // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
// string value = 1 [(buf.validate.field).string.strict = false];
// }
//
// “`
Strict *bool `protobuf:"varint,25,opt,name=strict" json:"strict,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyString {
// string value = 1 [
// (buf.validate.field).string.example = "hello",
// (buf.validate.field).string.example = "world"
// ];
// }
//
// “`
Example []string `protobuf:"bytes,34,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
StringRules describes the rules applied to `string` values These rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
func (*StringRules) ClearAddress ¶
func (x *StringRules) ClearAddress()
func (*StringRules) ClearConst ¶
func (x *StringRules) ClearConst()
func (*StringRules) ClearContains ¶
func (x *StringRules) ClearContains()
func (*StringRules) ClearEmail ¶
func (x *StringRules) ClearEmail()
func (*StringRules) ClearHostAndPort ¶
func (x *StringRules) ClearHostAndPort()
func (*StringRules) ClearHostname ¶
func (x *StringRules) ClearHostname()
func (*StringRules) ClearIp ¶
func (x *StringRules) ClearIp()
func (*StringRules) ClearIpPrefix ¶
func (x *StringRules) ClearIpPrefix()
func (*StringRules) ClearIpWithPrefixlen ¶
func (x *StringRules) ClearIpWithPrefixlen()
func (*StringRules) ClearIpv4 ¶
func (x *StringRules) ClearIpv4()
func (*StringRules) ClearIpv4Prefix ¶
func (x *StringRules) ClearIpv4Prefix()
func (*StringRules) ClearIpv4WithPrefixlen ¶
func (x *StringRules) ClearIpv4WithPrefixlen()
func (*StringRules) ClearIpv6 ¶
func (x *StringRules) ClearIpv6()
func (*StringRules) ClearIpv6Prefix ¶
func (x *StringRules) ClearIpv6Prefix()
func (*StringRules) ClearIpv6WithPrefixlen ¶
func (x *StringRules) ClearIpv6WithPrefixlen()
func (*StringRules) ClearLen ¶
func (x *StringRules) ClearLen()
func (*StringRules) ClearLenBytes ¶
func (x *StringRules) ClearLenBytes()
func (*StringRules) ClearMaxBytes ¶
func (x *StringRules) ClearMaxBytes()
func (*StringRules) ClearMaxLen ¶
func (x *StringRules) ClearMaxLen()
func (*StringRules) ClearMinBytes ¶
func (x *StringRules) ClearMinBytes()
func (*StringRules) ClearMinLen ¶
func (x *StringRules) ClearMinLen()
func (*StringRules) ClearNotContains ¶
func (x *StringRules) ClearNotContains()
func (*StringRules) ClearPattern ¶
func (x *StringRules) ClearPattern()
func (*StringRules) ClearPrefix ¶
func (x *StringRules) ClearPrefix()
func (*StringRules) ClearProtobufDotFqn ¶
func (x *StringRules) ClearProtobufDotFqn()
func (*StringRules) ClearProtobufFqn ¶
func (x *StringRules) ClearProtobufFqn()
func (*StringRules) ClearStrict ¶
func (x *StringRules) ClearStrict()
func (*StringRules) ClearSuffix ¶
func (x *StringRules) ClearSuffix()
func (*StringRules) ClearTuuid ¶
func (x *StringRules) ClearTuuid()
func (*StringRules) ClearUlid ¶
func (x *StringRules) ClearUlid()
func (*StringRules) ClearUri ¶
func (x *StringRules) ClearUri()
func (*StringRules) ClearUriRef ¶
func (x *StringRules) ClearUriRef()
func (*StringRules) ClearUuid ¶
func (x *StringRules) ClearUuid()
func (*StringRules) ClearWellKnown ¶
func (x *StringRules) ClearWellKnown()
func (*StringRules) ClearWellKnownRegex ¶
func (x *StringRules) ClearWellKnownRegex()
func (*StringRules) GetAddress ¶
func (x *StringRules) GetAddress() bool
func (*StringRules) GetConst ¶
func (x *StringRules) GetConst() string
func (*StringRules) GetContains ¶
func (x *StringRules) GetContains() string
func (*StringRules) GetEmail ¶
func (x *StringRules) GetEmail() bool
func (*StringRules) GetExample ¶
func (x *StringRules) GetExample() []string
func (*StringRules) GetHostAndPort ¶
func (x *StringRules) GetHostAndPort() bool
func (*StringRules) GetHostname ¶
func (x *StringRules) GetHostname() bool
func (*StringRules) GetIn ¶
func (x *StringRules) GetIn() []string
func (*StringRules) GetIp ¶
func (x *StringRules) GetIp() bool
func (*StringRules) GetIpPrefix ¶
func (x *StringRules) GetIpPrefix() bool
func (*StringRules) GetIpWithPrefixlen ¶
func (x *StringRules) GetIpWithPrefixlen() bool
func (*StringRules) GetIpv4 ¶
func (x *StringRules) GetIpv4() bool
func (*StringRules) GetIpv4Prefix ¶
func (x *StringRules) GetIpv4Prefix() bool
func (*StringRules) GetIpv4WithPrefixlen ¶
func (x *StringRules) GetIpv4WithPrefixlen() bool
func (*StringRules) GetIpv6 ¶
func (x *StringRules) GetIpv6() bool
func (*StringRules) GetIpv6Prefix ¶
func (x *StringRules) GetIpv6Prefix() bool
func (*StringRules) GetIpv6WithPrefixlen ¶
func (x *StringRules) GetIpv6WithPrefixlen() bool
func (*StringRules) GetLen ¶
func (x *StringRules) GetLen() uint64
func (*StringRules) GetLenBytes ¶
func (x *StringRules) GetLenBytes() uint64
func (*StringRules) GetMaxBytes ¶
func (x *StringRules) GetMaxBytes() uint64
func (*StringRules) GetMaxLen ¶
func (x *StringRules) GetMaxLen() uint64
func (*StringRules) GetMinBytes ¶
func (x *StringRules) GetMinBytes() uint64
func (*StringRules) GetMinLen ¶
func (x *StringRules) GetMinLen() uint64
func (*StringRules) GetNotContains ¶
func (x *StringRules) GetNotContains() string
func (*StringRules) GetNotIn ¶
func (x *StringRules) GetNotIn() []string
func (*StringRules) GetPattern ¶
func (x *StringRules) GetPattern() string
func (*StringRules) GetPrefix ¶
func (x *StringRules) GetPrefix() string
func (*StringRules) GetProtobufDotFqn ¶
func (x *StringRules) GetProtobufDotFqn() bool
func (*StringRules) GetProtobufFqn ¶
func (x *StringRules) GetProtobufFqn() bool
func (*StringRules) GetStrict ¶
func (x *StringRules) GetStrict() bool
func (*StringRules) GetSuffix ¶
func (x *StringRules) GetSuffix() string
func (*StringRules) GetTuuid ¶
func (x *StringRules) GetTuuid() bool
func (*StringRules) GetUlid ¶
func (x *StringRules) GetUlid() bool
func (*StringRules) GetUri ¶
func (x *StringRules) GetUri() bool
func (*StringRules) GetUriRef ¶
func (x *StringRules) GetUriRef() bool
func (*StringRules) GetUuid ¶
func (x *StringRules) GetUuid() bool
func (*StringRules) GetWellKnown ¶
func (x *StringRules) GetWellKnown() isStringRules_WellKnown
func (*StringRules) GetWellKnownRegex ¶
func (x *StringRules) GetWellKnownRegex() KnownRegex
func (*StringRules) HasAddress ¶
func (x *StringRules) HasAddress() bool
func (*StringRules) HasConst ¶
func (x *StringRules) HasConst() bool
func (*StringRules) HasContains ¶
func (x *StringRules) HasContains() bool
func (*StringRules) HasEmail ¶
func (x *StringRules) HasEmail() bool
func (*StringRules) HasHostAndPort ¶
func (x *StringRules) HasHostAndPort() bool
func (*StringRules) HasHostname ¶
func (x *StringRules) HasHostname() bool
func (*StringRules) HasIp ¶
func (x *StringRules) HasIp() bool
func (*StringRules) HasIpPrefix ¶
func (x *StringRules) HasIpPrefix() bool
func (*StringRules) HasIpWithPrefixlen ¶
func (x *StringRules) HasIpWithPrefixlen() bool
func (*StringRules) HasIpv4 ¶
func (x *StringRules) HasIpv4() bool
func (*StringRules) HasIpv4Prefix ¶
func (x *StringRules) HasIpv4Prefix() bool
func (*StringRules) HasIpv4WithPrefixlen ¶
func (x *StringRules) HasIpv4WithPrefixlen() bool
func (*StringRules) HasIpv6 ¶
func (x *StringRules) HasIpv6() bool
func (*StringRules) HasIpv6Prefix ¶
func (x *StringRules) HasIpv6Prefix() bool
func (*StringRules) HasIpv6WithPrefixlen ¶
func (x *StringRules) HasIpv6WithPrefixlen() bool
func (*StringRules) HasLen ¶
func (x *StringRules) HasLen() bool
func (*StringRules) HasLenBytes ¶
func (x *StringRules) HasLenBytes() bool
func (*StringRules) HasMaxBytes ¶
func (x *StringRules) HasMaxBytes() bool
func (*StringRules) HasMaxLen ¶
func (x *StringRules) HasMaxLen() bool
func (*StringRules) HasMinBytes ¶
func (x *StringRules) HasMinBytes() bool
func (*StringRules) HasMinLen ¶
func (x *StringRules) HasMinLen() bool
func (*StringRules) HasNotContains ¶
func (x *StringRules) HasNotContains() bool
func (*StringRules) HasPattern ¶
func (x *StringRules) HasPattern() bool
func (*StringRules) HasPrefix ¶
func (x *StringRules) HasPrefix() bool
func (*StringRules) HasProtobufDotFqn ¶
func (x *StringRules) HasProtobufDotFqn() bool
func (*StringRules) HasProtobufFqn ¶
func (x *StringRules) HasProtobufFqn() bool
func (*StringRules) HasStrict ¶
func (x *StringRules) HasStrict() bool
func (*StringRules) HasSuffix ¶
func (x *StringRules) HasSuffix() bool
func (*StringRules) HasTuuid ¶
func (x *StringRules) HasTuuid() bool
func (*StringRules) HasUlid ¶
func (x *StringRules) HasUlid() bool
func (*StringRules) HasUri ¶
func (x *StringRules) HasUri() bool
func (*StringRules) HasUriRef ¶
func (x *StringRules) HasUriRef() bool
func (*StringRules) HasUuid ¶
func (x *StringRules) HasUuid() bool
func (*StringRules) HasWellKnown ¶
func (x *StringRules) HasWellKnown() bool
func (*StringRules) HasWellKnownRegex ¶
func (x *StringRules) HasWellKnownRegex() bool
func (*StringRules) ProtoMessage ¶
func (*StringRules) ProtoMessage()
func (*StringRules) ProtoReflect ¶
func (x *StringRules) ProtoReflect() protoreflect.Message
func (*StringRules) Reset ¶
func (x *StringRules) Reset()
func (*StringRules) SetAddress ¶
func (x *StringRules) SetAddress(v bool)
func (*StringRules) SetConst ¶
func (x *StringRules) SetConst(v string)
func (*StringRules) SetContains ¶
func (x *StringRules) SetContains(v string)
func (*StringRules) SetEmail ¶
func (x *StringRules) SetEmail(v bool)
func (*StringRules) SetExample ¶
func (x *StringRules) SetExample(v []string)
func (*StringRules) SetHostAndPort ¶
func (x *StringRules) SetHostAndPort(v bool)
func (*StringRules) SetHostname ¶
func (x *StringRules) SetHostname(v bool)
func (*StringRules) SetIn ¶
func (x *StringRules) SetIn(v []string)
func (*StringRules) SetIp ¶
func (x *StringRules) SetIp(v bool)
func (*StringRules) SetIpPrefix ¶
func (x *StringRules) SetIpPrefix(v bool)
func (*StringRules) SetIpWithPrefixlen ¶
func (x *StringRules) SetIpWithPrefixlen(v bool)
func (*StringRules) SetIpv4 ¶
func (x *StringRules) SetIpv4(v bool)
func (*StringRules) SetIpv4Prefix ¶
func (x *StringRules) SetIpv4Prefix(v bool)
func (*StringRules) SetIpv4WithPrefixlen ¶
func (x *StringRules) SetIpv4WithPrefixlen(v bool)
func (*StringRules) SetIpv6 ¶
func (x *StringRules) SetIpv6(v bool)
func (*StringRules) SetIpv6Prefix ¶
func (x *StringRules) SetIpv6Prefix(v bool)
func (*StringRules) SetIpv6WithPrefixlen ¶
func (x *StringRules) SetIpv6WithPrefixlen(v bool)
func (*StringRules) SetLen ¶
func (x *StringRules) SetLen(v uint64)
func (*StringRules) SetLenBytes ¶
func (x *StringRules) SetLenBytes(v uint64)
func (*StringRules) SetMaxBytes ¶
func (x *StringRules) SetMaxBytes(v uint64)
func (*StringRules) SetMaxLen ¶
func (x *StringRules) SetMaxLen(v uint64)
func (*StringRules) SetMinBytes ¶
func (x *StringRules) SetMinBytes(v uint64)
func (*StringRules) SetMinLen ¶
func (x *StringRules) SetMinLen(v uint64)
func (*StringRules) SetNotContains ¶
func (x *StringRules) SetNotContains(v string)
func (*StringRules) SetNotIn ¶
func (x *StringRules) SetNotIn(v []string)
func (*StringRules) SetPattern ¶
func (x *StringRules) SetPattern(v string)
func (*StringRules) SetPrefix ¶
func (x *StringRules) SetPrefix(v string)
func (*StringRules) SetProtobufDotFqn ¶
func (x *StringRules) SetProtobufDotFqn(v bool)
func (*StringRules) SetProtobufFqn ¶
func (x *StringRules) SetProtobufFqn(v bool)
func (*StringRules) SetStrict ¶
func (x *StringRules) SetStrict(v bool)
func (*StringRules) SetSuffix ¶
func (x *StringRules) SetSuffix(v string)
func (*StringRules) SetTuuid ¶
func (x *StringRules) SetTuuid(v bool)
func (*StringRules) SetUlid ¶
func (x *StringRules) SetUlid(v bool)
func (*StringRules) SetUri ¶
func (x *StringRules) SetUri(v bool)
func (*StringRules) SetUriRef ¶
func (x *StringRules) SetUriRef(v bool)
func (*StringRules) SetUuid ¶
func (x *StringRules) SetUuid(v bool)
func (*StringRules) SetWellKnownRegex ¶
func (x *StringRules) SetWellKnownRegex(v KnownRegex)
func (*StringRules) String ¶
func (x *StringRules) String() string
func (*StringRules) WhichWellKnown ¶
func (x *StringRules) WhichWellKnown() case_StringRules_WellKnown
type StringRules_Address ¶
type StringRules_Address struct {
// `address` specifies that the field value must be either a valid hostname
// (for example, "example.com"), or a valid IP (v4 or v6) address (for example,
// "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid hostname, or ip address
// string value = 1 [(buf.validate.field).string.address = true];
// }
//
// “`
Address bool `protobuf:"varint,21,opt,name=address,oneof"`
}
type StringRules_Email ¶
type StringRules_Email struct {
// `email` specifies that the field value must be a valid email address, for
// example "foo@example.com".
//
// Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
// Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),
// which allows many unexpected forms of email addresses and will easily match
// a typographical error.
//
// If the field value isn't a valid email address, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid email address
// string value = 1 [(buf.validate.field).string.email = true];
// }
//
// “`
Email bool `protobuf:"varint,12,opt,name=email,oneof"`
}
type StringRules_HostAndPort ¶
type StringRules_HostAndPort struct {
// `host_and_port` specifies that the field value must be a valid host/port
// pair—for example, "example.com:8080".
//
// The host can be one of:
// - An IPv4 address in dotted decimal format—for example, "192.168.5.21".
// - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]".
// - A hostname—for example, "example.com".
//
// The port is separated by a colon. It must be non-empty, with a decimal number
// in the range of 0-65535, inclusive.
HostAndPort bool `protobuf:"varint,32,opt,name=host_and_port,json=hostAndPort,oneof"`
}
type StringRules_Hostname ¶
type StringRules_Hostname struct {
// `hostname` specifies that the field value must be a valid hostname, for
// example "foo.example.com".
//
// A valid hostname follows the rules below:
// - The name consists of one or more labels, separated by a dot (".").
// - Each label can be 1 to 63 alphanumeric characters.
// - A label can contain hyphens ("-"), but must not start or end with a hyphen.
// - The right-most label must not be digits only.
// - The name can have a trailing dot—for example, "foo.example.com.".
// - The name can be 253 characters at most, excluding the optional trailing dot.
//
// If the field value isn't a valid hostname, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid hostname
// string value = 1 [(buf.validate.field).string.hostname = true];
// }
//
// “`
Hostname bool `protobuf:"varint,13,opt,name=hostname,oneof"`
}
type StringRules_Ip ¶
type StringRules_Ip struct {
// `ip` specifies that the field value must be a valid IP (v4 or v6) address.
//
// IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21".
// IPv6 addresses are expected in their text representation—for example, "::1",
// or "2001:0DB8:ABCD:0012::0".
//
// Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
// Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported.
//
// If the field value isn't a valid IP address, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid IP address
// string value = 1 [(buf.validate.field).string.ip = true];
// }
//
// “`
Ip bool `protobuf:"varint,14,opt,name=ip,oneof"`
}
type StringRules_IpPrefix ¶
type StringRules_IpPrefix struct {
// `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)
// prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64".
//
// The prefix must have all zeros for the unmasked bits. For example,
// "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
// prefix, and the remaining 64 bits must be zero.
//
// If the field value isn't a valid IP prefix, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid IP prefix
// string value = 1 [(buf.validate.field).string.ip_prefix = true];
// }
//
// “`
IpPrefix bool `protobuf:"varint,29,opt,name=ip_prefix,json=ipPrefix,oneof"`
}
type StringRules_IpWithPrefixlen ¶
type StringRules_IpWithPrefixlen struct {
// `ip_with_prefixlen` specifies that the field value must be a valid IP
// (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or
// "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with
// prefix length, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IP with prefix length
// string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
// }
//
// “`
IpWithPrefixlen bool `protobuf:"varint,26,opt,name=ip_with_prefixlen,json=ipWithPrefixlen,oneof"`
}
type StringRules_Ipv4 ¶
type StringRules_Ipv4 struct {
// `ipv4` specifies that the field value must be a valid IPv4 address—for
// example "192.168.5.21". If the field value isn't a valid IPv4 address, an
// error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv4 address
// string value = 1 [(buf.validate.field).string.ipv4 = true];
// }
//
// “`
Ipv4 bool `protobuf:"varint,15,opt,name=ipv4,oneof"`
}
type StringRules_Ipv4Prefix ¶
type StringRules_Ipv4Prefix struct {
// `ipv4_prefix` specifies that the field value must be a valid IPv4
// prefix, for example "192.168.0.0/16".
//
// The prefix must have all zeros for the unmasked bits. For example,
// "192.168.0.0/16" designates the left-most 16 bits for the prefix,
// and the remaining 16 bits must be zero.
//
// If the field value isn't a valid IPv4 prefix, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv4 prefix
// string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
// }
//
// “`
Ipv4Prefix bool `protobuf:"varint,30,opt,name=ipv4_prefix,json=ipv4Prefix,oneof"`
}
type StringRules_Ipv4WithPrefixlen ¶
type StringRules_Ipv4WithPrefixlen struct {
// `ipv4_with_prefixlen` specifies that the field value must be a valid
// IPv4 address with prefix length—for example, "192.168.5.21/16". If the
// field value isn't a valid IPv4 address with prefix length, an error
// message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv4 address with prefix length
// string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
// }
//
// “`
Ipv4WithPrefixlen bool `protobuf:"varint,27,opt,name=ipv4_with_prefixlen,json=ipv4WithPrefixlen,oneof"`
}
type StringRules_Ipv6 ¶
type StringRules_Ipv6 struct {
// `ipv6` specifies that the field value must be a valid IPv6 address—for
// example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field
// value is not a valid IPv6 address, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv6 address
// string value = 1 [(buf.validate.field).string.ipv6 = true];
// }
//
// “`
Ipv6 bool `protobuf:"varint,16,opt,name=ipv6,oneof"`
}
type StringRules_Ipv6Prefix ¶
type StringRules_Ipv6Prefix struct {
// `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for
// example, "2001:0DB8:ABCD:0012::0/64".
//
// The prefix must have all zeros for the unmasked bits. For example,
// "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
// prefix, and the remaining 64 bits must be zero.
//
// If the field value is not a valid IPv6 prefix, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv6 prefix
// string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
// }
//
// “`
Ipv6Prefix bool `protobuf:"varint,31,opt,name=ipv6_prefix,json=ipv6Prefix,oneof"`
}
type StringRules_Ipv6WithPrefixlen ¶
type StringRules_Ipv6WithPrefixlen struct {
// `ipv6_with_prefixlen` specifies that the field value must be a valid
// IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64".
// If the field value is not a valid IPv6 address with prefix length,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv6 address prefix length
// string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
// }
//
// “`
Ipv6WithPrefixlen bool `protobuf:"varint,28,opt,name=ipv6_with_prefixlen,json=ipv6WithPrefixlen,oneof"`
}
type StringRules_ProtobufDotFqn ¶
type StringRules_ProtobufDotFqn struct {
// `protobuf_dot_fqn` specifies that the field value must be a valid fully-qualified
// Protobuf name with a leading dot, as defined by the
// [Protobuf Language Specification](https://protobuf.com/docs/language-spec).
//
// A fully-qualified Protobuf name with a leading dot is a dot followed by a
// dot-separated list of Protobuf identifiers, where each identifier starts with a
// letter or underscore and is followed by zero or more letters, underscores, or
// digits.
//
// Examples: ".buf.validate", ".google.protobuf.Timestamp", ".my_package.MyMessage".
//
// Note: this is the historical representation of fully-qualified Protobuf names,
// where a leading dot denotes an absolute reference. Modern Protobuf does not use
// the leading dot, and most fully-qualified names are represented without it. Most
// users will want to use `protobuf_fqn` instead.
//
// If the field value isn't a valid fully-qualified Protobuf name with a leading dot,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // value must be a valid fully-qualified Protobuf name with a leading dot
// string value = 1 [(buf.validate.field).string.protobuf_dot_fqn = true];
// }
//
// “`
ProtobufDotFqn bool `protobuf:"varint,38,opt,name=protobuf_dot_fqn,json=protobufDotFqn,oneof"`
}
type StringRules_ProtobufFqn ¶
type StringRules_ProtobufFqn struct {
// `protobuf_fqn` specifies that the field value must be a valid fully-qualified
// Protobuf name as defined by the [Protobuf Language Specification](https://protobuf.com/docs/language-spec).
//
// A fully-qualified Protobuf name is a dot-separated list of Protobuf identifiers,
// where each identifier starts with a letter or underscore and is followed by zero or
// more letters, underscores, or digits.
//
// Examples: "buf.validate", "google.protobuf.Timestamp", "my_package.MyMessage".
//
// Note: historically, fully-qualified Protobuf names were represented with a leading
// dot (for example, ".buf.validate.StringRules"). Modern Protobuf does not use the
// leading dot, and most fully-qualified names are represented without it. Use
// `protobuf_dot_fqn` if a leading dot is required.
//
// If the field value isn't a valid fully-qualified Protobuf name, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // value must be a valid fully-qualified Protobuf name
// string value = 1 [(buf.validate.field).string.protobuf_fqn = true];
// }
//
// “`
ProtobufFqn bool `protobuf:"varint,37,opt,name=protobuf_fqn,json=protobufFqn,oneof"`
}
type StringRules_Tuuid ¶
type StringRules_Tuuid struct {
// `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
// defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes
// omitted. If the field value isn't a valid UUID without dashes, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid trimmed UUID
// string value = 1 [(buf.validate.field).string.tuuid = true];
// }
//
// “`
Tuuid bool `protobuf:"varint,33,opt,name=tuuid,oneof"`
}
type StringRules_Ulid ¶
type StringRules_Ulid struct {
// `ulid` specifies that the field value must be a valid ULID (Universally Unique
// Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).
// If the field value isn't a valid ULID, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid ULID
// string value = 1 [(buf.validate.field).string.ulid = true];
// }
//
// “`
Ulid bool `protobuf:"varint,35,opt,name=ulid,oneof"`
}
type StringRules_Uri ¶
type StringRules_Uri struct {
// `uri` specifies that the field value must be a valid URI, for example
// "https://example.com/foo/bar?baz=quux#frag".
//
// URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
// Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
//
// If the field value isn't a valid URI, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid URI
// string value = 1 [(buf.validate.field).string.uri = true];
// }
//
// “`
Uri bool `protobuf:"varint,17,opt,name=uri,oneof"`
}
type StringRules_UriRef ¶
type StringRules_UriRef struct {
// `uri_ref` specifies that the field value must be a valid URI Reference—either
// a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative
// Reference such as "./foo/bar?query".
//
// URI, URI Reference, and Relative Reference are defined in the internet
// standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone
// Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
//
// If the field value isn't a valid URI Reference, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid URI Reference
// string value = 1 [(buf.validate.field).string.uri_ref = true];
// }
//
// “`
UriRef bool `protobuf:"varint,18,opt,name=uri_ref,json=uriRef,oneof"`
}
type StringRules_Uuid ¶
type StringRules_Uuid struct {
// `uuid` specifies that the field value must be a valid UUID as defined by
// [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the
// field value isn't a valid UUID, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid UUID
// string value = 1 [(buf.validate.field).string.uuid = true];
// }
//
// “`
Uuid bool `protobuf:"varint,22,opt,name=uuid,oneof"`
}
type StringRules_WellKnownRegex ¶
type StringRules_WellKnownRegex struct {
// `well_known_regex` specifies a common well-known pattern
// defined as a regex. If the field value doesn't match the well-known
// regex, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid HTTP header value
// string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
// }
//
// “`
//
// #### KnownRegex
//
// `well_known_regex` contains some well-known patterns.
//
// | Name | Number | Description |
// |-------------------------------|--------|-------------------------------------------|
// | KNOWN_REGEX_UNSPECIFIED | 0 | |
// | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) |
// | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |
WellKnownRegex KnownRegex `protobuf:"varint,24,opt,name=well_known_regex,json=wellKnownRegex,enum=buf.validate.KnownRegex,oneof"`
}
type StringRules_builder ¶
type StringRules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyString {
// // value must equal `hello`
// string value = 1 [(buf.validate.field).string.const = "hello"];
// }
//
// “`
Const *string
// `len` dictates that the field value must have the specified
// number of characters (Unicode code points), which may differ from the number
// of bytes in the string. If the field value does not meet the specified
// length, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be 5 characters
// string value = 1 [(buf.validate.field).string.len = 5];
// }
//
// “`
Len *uint64
// `min_len` specifies that the field value must have at least the specified
// number of characters (Unicode code points), which may differ from the number
// of bytes in the string. If the field value contains fewer characters, an error
// message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at least 3 characters
// string value = 1 [(buf.validate.field).string.min_len = 3];
// }
//
// “`
MinLen *uint64
// `max_len` specifies that the field value must have no more than the specified
// number of characters (Unicode code points), which may differ from the
// number of bytes in the string. If the field value contains more characters,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at most 10 characters
// string value = 1 [(buf.validate.field).string.max_len = 10];
// }
//
// “`
MaxLen *uint64
// `len_bytes` dictates that the field value must have the specified number of
// bytes. If the field value does not match the specified length in bytes,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be 6 bytes
// string value = 1 [(buf.validate.field).string.len_bytes = 6];
// }
//
// “`
LenBytes *uint64
// `min_bytes` specifies that the field value must have at least the specified
// number of bytes. If the field value contains fewer bytes, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at least 4 bytes
// string value = 1 [(buf.validate.field).string.min_bytes = 4];
// }
//
// “`
MinBytes *uint64
// `max_bytes` specifies that the field value must have no more than the
// specified number of bytes. If the field value contains more bytes, an
// error message will be generated.
//
// “`proto
//
// message MyString {
// // value length must be at most 8 bytes
// string value = 1 [(buf.validate.field).string.max_bytes = 8];
// }
//
// “`
MaxBytes *uint64
// `pattern` specifies that the field value must match the specified
// regular expression (RE2 syntax), with the expression provided without any
// delimiters. If the field value doesn't match the regular expression, an
// error message will be generated.
//
// “`proto
//
// message MyString {
// // value does not match regex pattern `^[a-zA-Z]//$`
// string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
// }
//
// “`
Pattern *string
// `prefix` specifies that the field value must have the
// specified substring at the beginning of the string. If the field value
// doesn't start with the specified prefix, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // value does not have prefix `pre`
// string value = 1 [(buf.validate.field).string.prefix = "pre"];
// }
//
// “`
Prefix *string
// `suffix` specifies that the field value must have the
// specified substring at the end of the string. If the field value doesn't
// end with the specified suffix, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value does not have suffix `post`
// string value = 1 [(buf.validate.field).string.suffix = "post"];
// }
//
// “`
Suffix *string
// `contains` specifies that the field value must have the
// specified substring anywhere in the string. If the field value doesn't
// contain the specified substring, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value does not contain substring `inside`.
// string value = 1 [(buf.validate.field).string.contains = "inside"];
// }
//
// “`
Contains *string
// `not_contains` specifies that the field value must not have the
// specified substring anywhere in the string. If the field value contains
// the specified substring, an error message will be generated.
//
// “`proto
//
// message MyString {
// // value contains substring `inside`.
// string value = 1 [(buf.validate.field).string.not_contains = "inside"];
// }
//
// “`
NotContains *string
// `in` specifies that the field value must be equal to one of the specified
// values. If the field value isn't one of the specified values, an error
// message will be generated.
//
// “`proto
//
// message MyString {
// // must be in list ["apple", "banana"]
// string value = 1 [(buf.validate.field).string = { in: ["apple", "banana"] }];
// }
//
// “`
In []string
// `not_in` specifies that the field value cannot be equal to any
// of the specified values. If the field value is one of the specified values,
// an error message will be generated.
// “`proto
//
// message MyString {
// // value must not be in list ["orange", "grape"]
// string value = 1 [(buf.validate.field).string = { not_in: ["orange", "grape"] }];
// }
//
// “`
NotIn []string
// Fields of oneof WellKnown:
// `email` specifies that the field value must be a valid email address, for
// example "foo@example.com".
//
// Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
// Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),
// which allows many unexpected forms of email addresses and will easily match
// a typographical error.
//
// If the field value isn't a valid email address, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid email address
// string value = 1 [(buf.validate.field).string.email = true];
// }
//
// “`
Email *bool
// `hostname` specifies that the field value must be a valid hostname, for
// example "foo.example.com".
//
// A valid hostname follows the rules below:
// - The name consists of one or more labels, separated by a dot (".").
// - Each label can be 1 to 63 alphanumeric characters.
// - A label can contain hyphens ("-"), but must not start or end with a hyphen.
// - The right-most label must not be digits only.
// - The name can have a trailing dot—for example, "foo.example.com.".
// - The name can be 253 characters at most, excluding the optional trailing dot.
//
// If the field value isn't a valid hostname, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid hostname
// string value = 1 [(buf.validate.field).string.hostname = true];
// }
//
// “`
Hostname *bool
// `ip` specifies that the field value must be a valid IP (v4 or v6) address.
//
// IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21".
// IPv6 addresses are expected in their text representation—for example, "::1",
// or "2001:0DB8:ABCD:0012::0".
//
// Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
// Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported.
//
// If the field value isn't a valid IP address, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid IP address
// string value = 1 [(buf.validate.field).string.ip = true];
// }
//
// “`
Ip *bool
// `ipv4` specifies that the field value must be a valid IPv4 address—for
// example "192.168.5.21". If the field value isn't a valid IPv4 address, an
// error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv4 address
// string value = 1 [(buf.validate.field).string.ipv4 = true];
// }
//
// “`
Ipv4 *bool
// `ipv6` specifies that the field value must be a valid IPv6 address—for
// example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field
// value is not a valid IPv6 address, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv6 address
// string value = 1 [(buf.validate.field).string.ipv6 = true];
// }
//
// “`
Ipv6 *bool
// `uri` specifies that the field value must be a valid URI, for example
// "https://example.com/foo/bar?baz=quux#frag".
//
// URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
// Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
//
// If the field value isn't a valid URI, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid URI
// string value = 1 [(buf.validate.field).string.uri = true];
// }
//
// “`
Uri *bool
// `uri_ref` specifies that the field value must be a valid URI Reference—either
// a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative
// Reference such as "./foo/bar?query".
//
// URI, URI Reference, and Relative Reference are defined in the internet
// standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone
// Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
//
// If the field value isn't a valid URI Reference, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid URI Reference
// string value = 1 [(buf.validate.field).string.uri_ref = true];
// }
//
// “`
UriRef *bool
// `address` specifies that the field value must be either a valid hostname
// (for example, "example.com"), or a valid IP (v4 or v6) address (for example,
// "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid hostname, or ip address
// string value = 1 [(buf.validate.field).string.address = true];
// }
//
// “`
Address *bool
// `uuid` specifies that the field value must be a valid UUID as defined by
// [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the
// field value isn't a valid UUID, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid UUID
// string value = 1 [(buf.validate.field).string.uuid = true];
// }
//
// “`
Uuid *bool
// `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
// defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes
// omitted. If the field value isn't a valid UUID without dashes, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid trimmed UUID
// string value = 1 [(buf.validate.field).string.tuuid = true];
// }
//
// “`
Tuuid *bool
// `ip_with_prefixlen` specifies that the field value must be a valid IP
// (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or
// "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with
// prefix length, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IP with prefix length
// string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
// }
//
// “`
IpWithPrefixlen *bool
// `ipv4_with_prefixlen` specifies that the field value must be a valid
// IPv4 address with prefix length—for example, "192.168.5.21/16". If the
// field value isn't a valid IPv4 address with prefix length, an error
// message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv4 address with prefix length
// string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
// }
//
// “`
Ipv4WithPrefixlen *bool
// `ipv6_with_prefixlen` specifies that the field value must be a valid
// IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64".
// If the field value is not a valid IPv6 address with prefix length,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv6 address prefix length
// string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
// }
//
// “`
Ipv6WithPrefixlen *bool
// `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)
// prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64".
//
// The prefix must have all zeros for the unmasked bits. For example,
// "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
// prefix, and the remaining 64 bits must be zero.
//
// If the field value isn't a valid IP prefix, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid IP prefix
// string value = 1 [(buf.validate.field).string.ip_prefix = true];
// }
//
// “`
IpPrefix *bool
// `ipv4_prefix` specifies that the field value must be a valid IPv4
// prefix, for example "192.168.0.0/16".
//
// The prefix must have all zeros for the unmasked bits. For example,
// "192.168.0.0/16" designates the left-most 16 bits for the prefix,
// and the remaining 16 bits must be zero.
//
// If the field value isn't a valid IPv4 prefix, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv4 prefix
// string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
// }
//
// “`
Ipv4Prefix *bool
// `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for
// example, "2001:0DB8:ABCD:0012::0/64".
//
// The prefix must have all zeros for the unmasked bits. For example,
// "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
// prefix, and the remaining 64 bits must be zero.
//
// If the field value is not a valid IPv6 prefix, an error message will be
// generated.
//
// “`proto
//
// message MyString {
// // must be a valid IPv6 prefix
// string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
// }
//
// “`
Ipv6Prefix *bool
// `host_and_port` specifies that the field value must be a valid host/port
// pair—for example, "example.com:8080".
//
// The host can be one of:
// - An IPv4 address in dotted decimal format—for example, "192.168.5.21".
// - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]".
// - A hostname—for example, "example.com".
//
// The port is separated by a colon. It must be non-empty, with a decimal number
// in the range of 0-65535, inclusive.
HostAndPort *bool
// `ulid` specifies that the field value must be a valid ULID (Universally Unique
// Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).
// If the field value isn't a valid ULID, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid ULID
// string value = 1 [(buf.validate.field).string.ulid = true];
// }
//
// “`
Ulid *bool
// `protobuf_fqn` specifies that the field value must be a valid fully-qualified
// Protobuf name as defined by the [Protobuf Language Specification](https://protobuf.com/docs/language-spec).
//
// A fully-qualified Protobuf name is a dot-separated list of Protobuf identifiers,
// where each identifier starts with a letter or underscore and is followed by zero or
// more letters, underscores, or digits.
//
// Examples: "buf.validate", "google.protobuf.Timestamp", "my_package.MyMessage".
//
// Note: historically, fully-qualified Protobuf names were represented with a leading
// dot (for example, ".buf.validate.StringRules"). Modern Protobuf does not use the
// leading dot, and most fully-qualified names are represented without it. Use
// `protobuf_dot_fqn` if a leading dot is required.
//
// If the field value isn't a valid fully-qualified Protobuf name, an error message
// will be generated.
//
// “`proto
//
// message MyString {
// // value must be a valid fully-qualified Protobuf name
// string value = 1 [(buf.validate.field).string.protobuf_fqn = true];
// }
//
// “`
ProtobufFqn *bool
// `protobuf_dot_fqn` specifies that the field value must be a valid fully-qualified
// Protobuf name with a leading dot, as defined by the
// [Protobuf Language Specification](https://protobuf.com/docs/language-spec).
//
// A fully-qualified Protobuf name with a leading dot is a dot followed by a
// dot-separated list of Protobuf identifiers, where each identifier starts with a
// letter or underscore and is followed by zero or more letters, underscores, or
// digits.
//
// Examples: ".buf.validate", ".google.protobuf.Timestamp", ".my_package.MyMessage".
//
// Note: this is the historical representation of fully-qualified Protobuf names,
// where a leading dot denotes an absolute reference. Modern Protobuf does not use
// the leading dot, and most fully-qualified names are represented without it. Most
// users will want to use `protobuf_fqn` instead.
//
// If the field value isn't a valid fully-qualified Protobuf name with a leading dot,
// an error message will be generated.
//
// “`proto
//
// message MyString {
// // value must be a valid fully-qualified Protobuf name with a leading dot
// string value = 1 [(buf.validate.field).string.protobuf_dot_fqn = true];
// }
//
// “`
ProtobufDotFqn *bool
// `well_known_regex` specifies a common well-known pattern
// defined as a regex. If the field value doesn't match the well-known
// regex, an error message will be generated.
//
// “`proto
//
// message MyString {
// // must be a valid HTTP header value
// string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
// }
//
// “`
//
// #### KnownRegex
//
// `well_known_regex` contains some well-known patterns.
//
// | Name | Number | Description |
// |-------------------------------|--------|-------------------------------------------|
// | KNOWN_REGEX_UNSPECIFIED | 0 | |
// | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) |
// | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |
WellKnownRegex *KnownRegex
// -- end of WellKnown
// This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
// enable strict header validation. By default, this is true, and HTTP header
// validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser
// validations that only disallow `\r\n\0` characters, which can be used to
// bypass header matching rules.
//
// “`proto
//
// message MyString {
// // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
// string value = 1 [(buf.validate.field).string.strict = false];
// }
//
// “`
Strict *bool
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyString {
// string value = 1 [
// (buf.validate.field).string.example = "hello",
// (buf.validate.field).string.example = "world"
// ];
// }
//
// “`
Example []string
// contains filtered or unexported fields
}
func (StringRules_builder) Build ¶
func (b0 StringRules_builder) Build() *StringRules
type TimestampRules ¶
type TimestampRules struct {
// `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.
//
// “`proto
//
// message MyTimestamp {
// // value must equal 2023-05-03T10:00:00Z
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];
// }
//
// “`
Const *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *TimestampRules_Lt
// *TimestampRules_Lte
// *TimestampRules_LtNow
LessThan isTimestampRules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *TimestampRules_Gt
// *TimestampRules_Gte
// *TimestampRules_GtNow
GreaterThan isTimestampRules_GreaterThan `protobuf_oneof:"greater_than"`
// `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // must be within 1 hour of now
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];
// }
//
// “`
Within *durationpb.Duration `protobuf:"bytes,9,opt,name=within" json:"within,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyTimestamp {
// google.protobuf.Timestamp value = 1 [
// (buf.validate.field).timestamp.example = { seconds: 1672444800 },
// (buf.validate.field).timestamp.example = { seconds: 1672531200 }
// ];
// }
//
// “`
Example []*timestamppb.Timestamp `protobuf:"bytes,10,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.
func (*TimestampRules) ClearConst ¶
func (x *TimestampRules) ClearConst()
func (*TimestampRules) ClearGreaterThan ¶
func (x *TimestampRules) ClearGreaterThan()
func (*TimestampRules) ClearGt ¶
func (x *TimestampRules) ClearGt()
func (*TimestampRules) ClearGtNow ¶
func (x *TimestampRules) ClearGtNow()
func (*TimestampRules) ClearGte ¶
func (x *TimestampRules) ClearGte()
func (*TimestampRules) ClearLessThan ¶
func (x *TimestampRules) ClearLessThan()
func (*TimestampRules) ClearLt ¶
func (x *TimestampRules) ClearLt()
func (*TimestampRules) ClearLtNow ¶
func (x *TimestampRules) ClearLtNow()
func (*TimestampRules) ClearLte ¶
func (x *TimestampRules) ClearLte()
func (*TimestampRules) ClearWithin ¶
func (x *TimestampRules) ClearWithin()
func (*TimestampRules) GetConst ¶
func (x *TimestampRules) GetConst() *timestamppb.Timestamp
func (*TimestampRules) GetExample ¶
func (x *TimestampRules) GetExample() []*timestamppb.Timestamp
func (*TimestampRules) GetGreaterThan ¶
func (x *TimestampRules) GetGreaterThan() isTimestampRules_GreaterThan
func (*TimestampRules) GetGt ¶
func (x *TimestampRules) GetGt() *timestamppb.Timestamp
func (*TimestampRules) GetGtNow ¶
func (x *TimestampRules) GetGtNow() bool
func (*TimestampRules) GetGte ¶
func (x *TimestampRules) GetGte() *timestamppb.Timestamp
func (*TimestampRules) GetLessThan ¶
func (x *TimestampRules) GetLessThan() isTimestampRules_LessThan
func (*TimestampRules) GetLt ¶
func (x *TimestampRules) GetLt() *timestamppb.Timestamp
func (*TimestampRules) GetLtNow ¶
func (x *TimestampRules) GetLtNow() bool
func (*TimestampRules) GetLte ¶
func (x *TimestampRules) GetLte() *timestamppb.Timestamp
func (*TimestampRules) GetWithin ¶
func (x *TimestampRules) GetWithin() *durationpb.Duration
func (*TimestampRules) HasConst ¶
func (x *TimestampRules) HasConst() bool
func (*TimestampRules) HasGreaterThan ¶
func (x *TimestampRules) HasGreaterThan() bool
func (*TimestampRules) HasGt ¶
func (x *TimestampRules) HasGt() bool
func (*TimestampRules) HasGtNow ¶
func (x *TimestampRules) HasGtNow() bool
func (*TimestampRules) HasGte ¶
func (x *TimestampRules) HasGte() bool
func (*TimestampRules) HasLessThan ¶
func (x *TimestampRules) HasLessThan() bool
func (*TimestampRules) HasLt ¶
func (x *TimestampRules) HasLt() bool
func (*TimestampRules) HasLtNow ¶
func (x *TimestampRules) HasLtNow() bool
func (*TimestampRules) HasLte ¶
func (x *TimestampRules) HasLte() bool
func (*TimestampRules) HasWithin ¶
func (x *TimestampRules) HasWithin() bool
func (*TimestampRules) ProtoMessage ¶
func (*TimestampRules) ProtoMessage()
func (*TimestampRules) ProtoReflect ¶
func (x *TimestampRules) ProtoReflect() protoreflect.Message
func (*TimestampRules) Reset ¶
func (x *TimestampRules) Reset()
func (*TimestampRules) SetConst ¶
func (x *TimestampRules) SetConst(v *timestamppb.Timestamp)
func (*TimestampRules) SetExample ¶
func (x *TimestampRules) SetExample(v []*timestamppb.Timestamp)
func (*TimestampRules) SetGt ¶
func (x *TimestampRules) SetGt(v *timestamppb.Timestamp)
func (*TimestampRules) SetGtNow ¶
func (x *TimestampRules) SetGtNow(v bool)
func (*TimestampRules) SetGte ¶
func (x *TimestampRules) SetGte(v *timestamppb.Timestamp)
func (*TimestampRules) SetLt ¶
func (x *TimestampRules) SetLt(v *timestamppb.Timestamp)
func (*TimestampRules) SetLtNow ¶
func (x *TimestampRules) SetLtNow(v bool)
func (*TimestampRules) SetLte ¶
func (x *TimestampRules) SetLte(v *timestamppb.Timestamp)
func (*TimestampRules) SetWithin ¶
func (x *TimestampRules) SetWithin(v *durationpb.Duration)
func (*TimestampRules) String ¶
func (x *TimestampRules) String() string
func (*TimestampRules) WhichGreaterThan ¶
func (x *TimestampRules) WhichGreaterThan() case_TimestampRules_GreaterThan
func (*TimestampRules) WhichLessThan ¶
func (x *TimestampRules) WhichLessThan() case_TimestampRules_LessThan
type TimestampRules_Gt ¶
type TimestampRules_Gt struct {
// `gt` requires the timestamp field value to be greater than the specified
// value (exclusive). If the value of `gt` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];
//
// // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]
// google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
//
// // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]
// google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
// }
//
// “`
Gt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=gt,oneof"`
}
type TimestampRules_GtNow ¶
type TimestampRules_GtNow struct {
// `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.
//
// “`proto
//
// message MyTimestamp {
// // must be greater than now
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];
// }
//
// “`
GtNow bool `protobuf:"varint,8,opt,name=gt_now,json=gtNow,oneof"`
}
type TimestampRules_Gte ¶
type TimestampRules_Gte struct {
// `gte` requires the timestamp field value to be greater than or equal to the
// specified value (exclusive). If the value of `gte` is larger than a
// specified `lt` or `lte`, the range is reversed, and the field value
// must be outside the specified range. If the field value doesn't meet
// the required conditions, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];
//
// // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]
// google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
//
// // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]
// google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
// }
//
// “`
Gte *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=gte,oneof"`
}
type TimestampRules_Lt ¶
type TimestampRules_Lt struct {
// `lt` requires the timestamp field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be less than '2023-01-01T00:00:00Z' [timestamp.lt]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lt = { seconds: 1672444800 }];
// }
//
// “`
Lt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=lt,oneof"`
}
type TimestampRules_LtNow ¶
type TimestampRules_LtNow struct {
// `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.
//
// “`proto
//
// message MyTimestamp {
// // must be less than now
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];
// }
//
// “`
LtNow bool `protobuf:"varint,7,opt,name=lt_now,json=ltNow,oneof"`
}
type TimestampRules_Lte ¶
type TimestampRules_Lte struct {
// `lte` requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];
// }
//
// “`
Lte *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=lte,oneof"`
}
type TimestampRules_builder ¶
type TimestampRules_builder struct {
// `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.
//
// “`proto
//
// message MyTimestamp {
// // value must equal 2023-05-03T10:00:00Z
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];
// }
//
// “`
Const *timestamppb.Timestamp
// Fields of oneof LessThan:
// `lt` requires the timestamp field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be less than '2023-01-01T00:00:00Z' [timestamp.lt]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lt = { seconds: 1672444800 }];
// }
//
// “`
Lt *timestamppb.Timestamp
// `lte` requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];
// }
//
// “`
Lte *timestamppb.Timestamp
// `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.
//
// “`proto
//
// message MyTimestamp {
// // must be less than now
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];
// }
//
// “`
LtNow *bool
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the timestamp field value to be greater than the specified
// value (exclusive). If the value of `gt` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];
//
// // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]
// google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
//
// // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]
// google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
// }
//
// “`
Gt *timestamppb.Timestamp
// `gte` requires the timestamp field value to be greater than or equal to the
// specified value (exclusive). If the value of `gte` is larger than a
// specified `lt` or `lte`, the range is reversed, and the field value
// must be outside the specified range. If the field value doesn't meet
// the required conditions, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]
// google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];
//
// // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]
// google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
//
// // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]
// google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
// }
//
// “`
Gte *timestamppb.Timestamp
// `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.
//
// “`proto
//
// message MyTimestamp {
// // must be greater than now
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];
// }
//
// “`
GtNow *bool
// -- end of GreaterThan
// `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.
//
// “`proto
//
// message MyTimestamp {
// // must be within 1 hour of now
// google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];
// }
//
// “`
Within *durationpb.Duration
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyTimestamp {
// google.protobuf.Timestamp value = 1 [
// (buf.validate.field).timestamp.example = { seconds: 1672444800 },
// (buf.validate.field).timestamp.example = { seconds: 1672531200 }
// ];
// }
//
// “`
Example []*timestamppb.Timestamp
// contains filtered or unexported fields
}
func (TimestampRules_builder) Build ¶
func (b0 TimestampRules_builder) Build() *TimestampRules
type UInt32Rules ¶
type UInt32Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // value must equal 42
// uint32 value = 1 [(buf.validate.field).uint32.const = 42];
// }
//
// “`
Const *uint32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *UInt32Rules_Lt
// *UInt32Rules_Lte
LessThan isUInt32Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *UInt32Rules_Gt
// *UInt32Rules_Gte
GreaterThan isUInt32Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyUInt32 {
// // must be in list [1, 2, 3]
// uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint32 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyUInt32 {
// // value must not be in list [1, 2, 3]
// uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint32 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyUInt32 {
// uint32 value = 1 [
// (buf.validate.field).uint32.example = 1,
// (buf.validate.field).uint32.example = 10
// ];
// }
//
// “`
Example []uint32 `protobuf:"varint,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
UInt32Rules describes the rules applied to `uint32` values. These rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.
func (*UInt32Rules) ClearConst ¶
func (x *UInt32Rules) ClearConst()
func (*UInt32Rules) ClearGreaterThan ¶
func (x *UInt32Rules) ClearGreaterThan()
func (*UInt32Rules) ClearGt ¶
func (x *UInt32Rules) ClearGt()
func (*UInt32Rules) ClearGte ¶
func (x *UInt32Rules) ClearGte()
func (*UInt32Rules) ClearLessThan ¶
func (x *UInt32Rules) ClearLessThan()
func (*UInt32Rules) ClearLt ¶
func (x *UInt32Rules) ClearLt()
func (*UInt32Rules) ClearLte ¶
func (x *UInt32Rules) ClearLte()
func (*UInt32Rules) GetConst ¶
func (x *UInt32Rules) GetConst() uint32
func (*UInt32Rules) GetExample ¶
func (x *UInt32Rules) GetExample() []uint32
func (*UInt32Rules) GetGreaterThan ¶
func (x *UInt32Rules) GetGreaterThan() isUInt32Rules_GreaterThan
func (*UInt32Rules) GetGt ¶
func (x *UInt32Rules) GetGt() uint32
func (*UInt32Rules) GetGte ¶
func (x *UInt32Rules) GetGte() uint32
func (*UInt32Rules) GetIn ¶
func (x *UInt32Rules) GetIn() []uint32
func (*UInt32Rules) GetLessThan ¶
func (x *UInt32Rules) GetLessThan() isUInt32Rules_LessThan
func (*UInt32Rules) GetLt ¶
func (x *UInt32Rules) GetLt() uint32
func (*UInt32Rules) GetLte ¶
func (x *UInt32Rules) GetLte() uint32
func (*UInt32Rules) GetNotIn ¶
func (x *UInt32Rules) GetNotIn() []uint32
func (*UInt32Rules) HasConst ¶
func (x *UInt32Rules) HasConst() bool
func (*UInt32Rules) HasGreaterThan ¶
func (x *UInt32Rules) HasGreaterThan() bool
func (*UInt32Rules) HasGt ¶
func (x *UInt32Rules) HasGt() bool
func (*UInt32Rules) HasGte ¶
func (x *UInt32Rules) HasGte() bool
func (*UInt32Rules) HasLessThan ¶
func (x *UInt32Rules) HasLessThan() bool
func (*UInt32Rules) HasLt ¶
func (x *UInt32Rules) HasLt() bool
func (*UInt32Rules) HasLte ¶
func (x *UInt32Rules) HasLte() bool
func (*UInt32Rules) ProtoMessage ¶
func (*UInt32Rules) ProtoMessage()
func (*UInt32Rules) ProtoReflect ¶
func (x *UInt32Rules) ProtoReflect() protoreflect.Message
func (*UInt32Rules) Reset ¶
func (x *UInt32Rules) Reset()
func (*UInt32Rules) SetConst ¶
func (x *UInt32Rules) SetConst(v uint32)
func (*UInt32Rules) SetExample ¶
func (x *UInt32Rules) SetExample(v []uint32)
func (*UInt32Rules) SetGt ¶
func (x *UInt32Rules) SetGt(v uint32)
func (*UInt32Rules) SetGte ¶
func (x *UInt32Rules) SetGte(v uint32)
func (*UInt32Rules) SetIn ¶
func (x *UInt32Rules) SetIn(v []uint32)
func (*UInt32Rules) SetLt ¶
func (x *UInt32Rules) SetLt(v uint32)
func (*UInt32Rules) SetLte ¶
func (x *UInt32Rules) SetLte(v uint32)
func (*UInt32Rules) SetNotIn ¶
func (x *UInt32Rules) SetNotIn(v []uint32)
func (*UInt32Rules) String ¶
func (x *UInt32Rules) String() string
func (*UInt32Rules) WhichGreaterThan ¶
func (x *UInt32Rules) WhichGreaterThan() case_UInt32Rules_GreaterThan
func (*UInt32Rules) WhichLessThan ¶
func (x *UInt32Rules) WhichLessThan() case_UInt32Rules_LessThan
type UInt32Rules_Gt ¶
type UInt32Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be greater than 5 [uint32.gt]
// uint32 value = 1 [(buf.validate.field).uint32.gt = 5];
//
// // must be greater than 5 and less than 10 [uint32.gt_lt]
// uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]
// uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt uint32 `protobuf:"varint,4,opt,name=gt,oneof"`
}
type UInt32Rules_Gte ¶
type UInt32Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be greater than or equal to 5 [uint32.gte]
// uint32 value = 1 [(buf.validate.field).uint32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [uint32.gte_lt]
// uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]
// uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte uint32 `protobuf:"varint,5,opt,name=gte,oneof"`
}
type UInt32Rules_Lt ¶
type UInt32Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be less than 10
// uint32 value = 1 [(buf.validate.field).uint32.lt = 10];
// }
//
// “`
Lt uint32 `protobuf:"varint,2,opt,name=lt,oneof"`
}
type UInt32Rules_Lte ¶
type UInt32Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be less than or equal to 10
// uint32 value = 1 [(buf.validate.field).uint32.lte = 10];
// }
//
// “`
Lte uint32 `protobuf:"varint,3,opt,name=lte,oneof"`
}
type UInt32Rules_builder ¶
type UInt32Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // value must equal 42
// uint32 value = 1 [(buf.validate.field).uint32.const = 42];
// }
//
// “`
Const *uint32
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be less than 10
// uint32 value = 1 [(buf.validate.field).uint32.lt = 10];
// }
//
// “`
Lt *uint32
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be less than or equal to 10
// uint32 value = 1 [(buf.validate.field).uint32.lte = 10];
// }
//
// “`
Lte *uint32
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be greater than 5 [uint32.gt]
// uint32 value = 1 [(buf.validate.field).uint32.gt = 5];
//
// // must be greater than 5 and less than 10 [uint32.gt_lt]
// uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]
// uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *uint32
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt32 {
// // must be greater than or equal to 5 [uint32.gte]
// uint32 value = 1 [(buf.validate.field).uint32.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [uint32.gte_lt]
// uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]
// uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *uint32
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyUInt32 {
// // must be in list [1, 2, 3]
// uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint32
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyUInt32 {
// // value must not be in list [1, 2, 3]
// uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint32
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyUInt32 {
// uint32 value = 1 [
// (buf.validate.field).uint32.example = 1,
// (buf.validate.field).uint32.example = 10
// ];
// }
//
// “`
Example []uint32
// contains filtered or unexported fields
}
func (UInt32Rules_builder) Build ¶
func (b0 UInt32Rules_builder) Build() *UInt32Rules
type UInt64Rules ¶
type UInt64Rules struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // value must equal 42
// uint64 value = 1 [(buf.validate.field).uint64.const = 42];
// }
//
// “`
Const *uint64 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"`
// Types that are valid to be assigned to LessThan:
//
// *UInt64Rules_Lt
// *UInt64Rules_Lte
LessThan isUInt64Rules_LessThan `protobuf_oneof:"less_than"`
// Types that are valid to be assigned to GreaterThan:
//
// *UInt64Rules_Gt
// *UInt64Rules_Gte
GreaterThan isUInt64Rules_GreaterThan `protobuf_oneof:"greater_than"`
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyUInt64 {
// // must be in list [1, 2, 3]
// uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint64 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"`
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyUInt64 {
// // value must not be in list [1, 2, 3]
// uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint64 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"`
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyUInt64 {
// uint64 value = 1 [
// (buf.validate.field).uint64.example = 1,
// (buf.validate.field).uint64.example = 10
// ];
// }
//
// “`
Example []uint64 `protobuf:"varint,8,rep,name=example" json:"example,omitempty"`
// contains filtered or unexported fields
}
UInt64Rules describes the rules applied to `uint64` values. These rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.
func (*UInt64Rules) ClearConst ¶
func (x *UInt64Rules) ClearConst()
func (*UInt64Rules) ClearGreaterThan ¶
func (x *UInt64Rules) ClearGreaterThan()
func (*UInt64Rules) ClearGt ¶
func (x *UInt64Rules) ClearGt()
func (*UInt64Rules) ClearGte ¶
func (x *UInt64Rules) ClearGte()
func (*UInt64Rules) ClearLessThan ¶
func (x *UInt64Rules) ClearLessThan()
func (*UInt64Rules) ClearLt ¶
func (x *UInt64Rules) ClearLt()
func (*UInt64Rules) ClearLte ¶
func (x *UInt64Rules) ClearLte()
func (*UInt64Rules) GetConst ¶
func (x *UInt64Rules) GetConst() uint64
func (*UInt64Rules) GetExample ¶
func (x *UInt64Rules) GetExample() []uint64
func (*UInt64Rules) GetGreaterThan ¶
func (x *UInt64Rules) GetGreaterThan() isUInt64Rules_GreaterThan
func (*UInt64Rules) GetGt ¶
func (x *UInt64Rules) GetGt() uint64
func (*UInt64Rules) GetGte ¶
func (x *UInt64Rules) GetGte() uint64
func (*UInt64Rules) GetIn ¶
func (x *UInt64Rules) GetIn() []uint64
func (*UInt64Rules) GetLessThan ¶
func (x *UInt64Rules) GetLessThan() isUInt64Rules_LessThan
func (*UInt64Rules) GetLt ¶
func (x *UInt64Rules) GetLt() uint64
func (*UInt64Rules) GetLte ¶
func (x *UInt64Rules) GetLte() uint64
func (*UInt64Rules) GetNotIn ¶
func (x *UInt64Rules) GetNotIn() []uint64
func (*UInt64Rules) HasConst ¶
func (x *UInt64Rules) HasConst() bool
func (*UInt64Rules) HasGreaterThan ¶
func (x *UInt64Rules) HasGreaterThan() bool
func (*UInt64Rules) HasGt ¶
func (x *UInt64Rules) HasGt() bool
func (*UInt64Rules) HasGte ¶
func (x *UInt64Rules) HasGte() bool
func (*UInt64Rules) HasLessThan ¶
func (x *UInt64Rules) HasLessThan() bool
func (*UInt64Rules) HasLt ¶
func (x *UInt64Rules) HasLt() bool
func (*UInt64Rules) HasLte ¶
func (x *UInt64Rules) HasLte() bool
func (*UInt64Rules) ProtoMessage ¶
func (*UInt64Rules) ProtoMessage()
func (*UInt64Rules) ProtoReflect ¶
func (x *UInt64Rules) ProtoReflect() protoreflect.Message
func (*UInt64Rules) Reset ¶
func (x *UInt64Rules) Reset()
func (*UInt64Rules) SetConst ¶
func (x *UInt64Rules) SetConst(v uint64)
func (*UInt64Rules) SetExample ¶
func (x *UInt64Rules) SetExample(v []uint64)
func (*UInt64Rules) SetGt ¶
func (x *UInt64Rules) SetGt(v uint64)
func (*UInt64Rules) SetGte ¶
func (x *UInt64Rules) SetGte(v uint64)
func (*UInt64Rules) SetIn ¶
func (x *UInt64Rules) SetIn(v []uint64)
func (*UInt64Rules) SetLt ¶
func (x *UInt64Rules) SetLt(v uint64)
func (*UInt64Rules) SetLte ¶
func (x *UInt64Rules) SetLte(v uint64)
func (*UInt64Rules) SetNotIn ¶
func (x *UInt64Rules) SetNotIn(v []uint64)
func (*UInt64Rules) String ¶
func (x *UInt64Rules) String() string
func (*UInt64Rules) WhichGreaterThan ¶
func (x *UInt64Rules) WhichGreaterThan() case_UInt64Rules_GreaterThan
func (*UInt64Rules) WhichLessThan ¶
func (x *UInt64Rules) WhichLessThan() case_UInt64Rules_LessThan
type UInt64Rules_Gt ¶
type UInt64Rules_Gt struct {
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be greater than 5 [uint64.gt]
// uint64 value = 1 [(buf.validate.field).uint64.gt = 5];
//
// // must be greater than 5 and less than 10 [uint64.gt_lt]
// uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]
// uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt uint64 `protobuf:"varint,4,opt,name=gt,oneof"`
}
type UInt64Rules_Gte ¶
type UInt64Rules_Gte struct {
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be greater than or equal to 5 [uint64.gte]
// uint64 value = 1 [(buf.validate.field).uint64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [uint64.gte_lt]
// uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]
// uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte uint64 `protobuf:"varint,5,opt,name=gte,oneof"`
}
type UInt64Rules_Lt ¶
type UInt64Rules_Lt struct {
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be less than 10
// uint64 value = 1 [(buf.validate.field).uint64.lt = 10];
// }
//
// “`
Lt uint64 `protobuf:"varint,2,opt,name=lt,oneof"`
}
type UInt64Rules_Lte ¶
type UInt64Rules_Lte struct {
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be less than or equal to 10
// uint64 value = 1 [(buf.validate.field).uint64.lte = 10];
// }
//
// “`
Lte uint64 `protobuf:"varint,3,opt,name=lte,oneof"`
}
type UInt64Rules_builder ¶
type UInt64Rules_builder struct {
// `const` requires the field value to exactly match the specified value. If
// the field value doesn't match, an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // value must equal 42
// uint64 value = 1 [(buf.validate.field).uint64.const = 42];
// }
//
// “`
Const *uint64
// Fields of oneof LessThan:
// `lt` requires the field value to be less than the specified value (field <
// value). If the field value is equal to or greater than the specified value,
// an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be less than 10
// uint64 value = 1 [(buf.validate.field).uint64.lt = 10];
// }
//
// “`
Lt *uint64
// `lte` requires the field value to be less than or equal to the specified
// value (field <= value). If the field value is greater than the specified
// value, an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be less than or equal to 10
// uint64 value = 1 [(buf.validate.field).uint64.lte = 10];
// }
//
// “`
Lte *uint64
// -- end of LessThan
// Fields of oneof GreaterThan:
// `gt` requires the field value to be greater than the specified value
// (exclusive). If the value of `gt` is larger than a specified `lt` or
// `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be greater than 5 [uint64.gt]
// uint64 value = 1 [(buf.validate.field).uint64.gt = 5];
//
// // must be greater than 5 and less than 10 [uint64.gt_lt]
// uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];
//
// // must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]
// uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];
// }
//
// “`
Gt *uint64
// `gte` requires the field value to be greater than or equal to the specified
// value (exclusive). If the value of `gte` is larger than a specified `lt`
// or `lte`, the range is reversed, and the field value must be outside the
// specified range. If the field value doesn't meet the required conditions,
// an error message is generated.
//
// “`proto
//
// message MyUInt64 {
// // must be greater than or equal to 5 [uint64.gte]
// uint64 value = 1 [(buf.validate.field).uint64.gte = 5];
//
// // must be greater than or equal to 5 and less than 10 [uint64.gte_lt]
// uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];
//
// // must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]
// uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];
// }
//
// “`
Gte *uint64
// -- end of GreaterThan
// `in` requires the field value to be equal to one of the specified values.
// If the field value isn't one of the specified values, an error message is
// generated.
//
// “`proto
//
// message MyUInt64 {
// // must be in list [1, 2, 3]
// uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];
// }
//
// “`
In []uint64
// `not_in` requires the field value to not be equal to any of the specified
// values. If the field value is one of the specified values, an error
// message is generated.
//
// “`proto
//
// message MyUInt64 {
// // value must not be in list [1, 2, 3]
// uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];
// }
//
// “`
NotIn []uint64
// `example` specifies values that the field may have. These values SHOULD
// conform to other rules. `example` values will not impact validation
// but may be used as helpful guidance on how to populate the given field.
//
// “`proto
//
// message MyUInt64 {
// uint64 value = 1 [
// (buf.validate.field).uint64.example = 1,
// (buf.validate.field).uint64.example = 10
// ];
// }
//
// “`
Example []uint64
// contains filtered or unexported fields
}
func (UInt64Rules_builder) Build ¶
func (b0 UInt64Rules_builder) Build() *UInt64Rules
type Violation ¶
type Violation struct {
// `field` is a machine-readable path to the field that failed validation.
// This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
//
// For example, consider the following message:
//
// “`proto
//
// message Message {
// bool a = 1 [(buf.validate.field).required = true];
// }
//
// “`
//
// It could produce the following violation:
//
// “`textproto
//
// violation {
// field { element { field_number: 1, field_name: "a", field_type: 8 } }
// ...
// }
//
// “`
Field *FieldPath `protobuf:"bytes,5,opt,name=field" json:"field,omitempty"`
// `rule` is a machine-readable path that points to the specific rule that failed validation.
// This will be a nested field starting from the FieldRules of the field that failed validation.
// For custom rules, this will provide the path of the rule, e.g. `cel[0]`.
//
// For example, consider the following message:
//
// “`proto
//
// message Message {
// bool a = 1 [(buf.validate.field).required = true];
// bool b = 2 [(buf.validate.field).cel = {
// id: "custom_rule",
// expression: "!this ? 'b must be true': ”"
// }];
// }
//
// “`
//
// It could produce the following violations:
//
// “`textproto
//
// violation {
// rule { element { field_number: 25, field_name: "required", field_type: 8 } }
// ...
// }
//
// violation {
// rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } }
// ...
// }
//
// “`
Rule *FieldPath `protobuf:"bytes,6,opt,name=rule" json:"rule,omitempty"`
// `rule_id` is the unique identifier of the `Rule` that was not fulfilled.
// This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.
RuleId *string `protobuf:"bytes,2,opt,name=rule_id,json=ruleId" json:"rule_id,omitempty"`
// `message` is a human-readable error message that describes the nature of the violation.
// This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.
Message *string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"`
// `for_key` indicates whether the violation was caused by a map key, rather than a value.
ForKey *bool `protobuf:"varint,4,opt,name=for_key,json=forKey" json:"for_key,omitempty"`
// contains filtered or unexported fields
}
`Violation` represents a single instance where a validation rule, expressed as a `Rule`, was not met. It provides information about the field that caused the violation, the specific rule that wasn't fulfilled, and a human-readable error message.
For example, consider the following message:
```proto
message User {
int32 age = 1 [(buf.validate.field).cel = {
id: "user.age",
expression: "this < 18 ? 'User must be at least 18 years old' : ''",
}];
}
```
It could produce the following violation:
```json
{
"ruleId": "user.age",
"message": "User must be at least 18 years old",
"field": {
"elements": [
{
"fieldNumber": 1,
"fieldName": "age",
"fieldType": "TYPE_INT32"
}
]
},
"rule": {
"elements": [
{
"fieldNumber": 23,
"fieldName": "cel",
"fieldType": "TYPE_MESSAGE",
"index": "0"
}
]
}
}
```
func (*Violation) ProtoReflect ¶
func (x *Violation) ProtoReflect() protoreflect.Message
type Violation_builder ¶
type Violation_builder struct {
// `field` is a machine-readable path to the field that failed validation.
// This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
//
// For example, consider the following message:
//
// “`proto
//
// message Message {
// bool a = 1 [(buf.validate.field).required = true];
// }
//
// “`
//
// It could produce the following violation:
//
// “`textproto
//
// violation {
// field { element { field_number: 1, field_name: "a", field_type: 8 } }
// ...
// }
//
// “`
Field *FieldPath
// `rule` is a machine-readable path that points to the specific rule that failed validation.
// This will be a nested field starting from the FieldRules of the field that failed validation.
// For custom rules, this will provide the path of the rule, e.g. `cel[0]`.
//
// For example, consider the following message:
//
// “`proto
//
// message Message {
// bool a = 1 [(buf.validate.field).required = true];
// bool b = 2 [(buf.validate.field).cel = {
// id: "custom_rule",
// expression: "!this ? 'b must be true': ”"
// }];
// }
//
// “`
//
// It could produce the following violations:
//
// “`textproto
//
// violation {
// rule { element { field_number: 25, field_name: "required", field_type: 8 } }
// ...
// }
//
// violation {
// rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } }
// ...
// }
//
// “`
Rule *FieldPath
// `rule_id` is the unique identifier of the `Rule` that was not fulfilled.
// This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.
RuleId *string
// `message` is a human-readable error message that describes the nature of the violation.
// This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.
Message *string
// `for_key` indicates whether the violation was caused by a map key, rather than a value.
ForKey *bool
// contains filtered or unexported fields
}
func (Violation_builder) Build ¶
func (b0 Violation_builder) Build() *Violation
type Violations ¶
type Violations struct {
// `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.
Violations []*Violation `protobuf:"bytes,1,rep,name=violations" json:"violations,omitempty"`
// contains filtered or unexported fields
}
`Violations` is a collection of `Violation` messages. This message type is returned by Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules. Each individual violation is represented by a `Violation` message.
func (*Violations) GetViolations ¶
func (x *Violations) GetViolations() []*Violation
func (*Violations) ProtoMessage ¶
func (*Violations) ProtoMessage()
func (*Violations) ProtoReflect ¶
func (x *Violations) ProtoReflect() protoreflect.Message
func (*Violations) Reset ¶
func (x *Violations) Reset()
func (*Violations) SetViolations ¶
func (x *Violations) SetViolations(v []*Violation)
func (*Violations) String ¶
func (x *Violations) String() string
type Violations_builder ¶
type Violations_builder struct {
// `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.
Violations []*Violation
// contains filtered or unexported fields
}
func (Violations_builder) Build ¶
func (b0 Violations_builder) Build() *Violations
Source Files
¶
- validate.pb.go