Documentation ¶
Index ¶
- Variables
- type FieldValidation
- func (*FieldValidation) Descriptor() ([]byte, []int)
- func (m *FieldValidation) GetContains() string
- func (m *FieldValidation) GetDoNotValidate() string
- func (m *FieldValidation) GetEqLen() int64
- func (m *FieldValidation) GetError() string
- func (m *FieldValidation) GetFloatEq() float64
- func (m *FieldValidation) GetFloatGte() float64
- func (m *FieldValidation) GetFloatLte() float64
- func (m *FieldValidation) GetIntEq() int64
- func (m *FieldValidation) GetIntGte() int64
- func (m *FieldValidation) GetIntLte() int64
- func (m *FieldValidation) GetIsEmail() bool
- func (m *FieldValidation) GetIsIso8601Date() bool
- func (m *FieldValidation) GetIsUuid() bool
- func (m *FieldValidation) GetLc() bool
- func (m *FieldValidation) GetMatches() string
- func (m *FieldValidation) GetMaxLen() int64
- func (m *FieldValidation) GetMinLen() int64
- func (m *FieldValidation) GetNotEmptyString() bool
- func (m *FieldValidation) GetRegex() string
- func (m *FieldValidation) GetTransformFunc() string
- func (m *FieldValidation) GetTrim() bool
- func (m *FieldValidation) GetUc() bool
- func (m *FieldValidation) Marshal() (dAtA []byte, err error)
- func (m *FieldValidation) MarshalTo(dAtA []byte) (int, error)
- func (m *FieldValidation) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*FieldValidation) ProtoMessage()
- func (m *FieldValidation) Reset()
- func (m *FieldValidation) Size() (n int)
- func (m *FieldValidation) String() string
- func (m *FieldValidation) Unmarshal(dAtA []byte) error
- func (m *FieldValidation) XXX_DiscardUnknown()
- func (m *FieldValidation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FieldValidation) XXX_Merge(src proto.Message)
- func (m *FieldValidation) XXX_Size() int
- func (m *FieldValidation) XXX_Unmarshal(b []byte) error
- type MessageValidation
- func (*MessageValidation) Descriptor() ([]byte, []int)
- func (m *MessageValidation) GetReturnOnError() bool
- func (m *MessageValidation) GetTrimStrings() bool
- func (m *MessageValidation) Marshal() (dAtA []byte, err error)
- func (m *MessageValidation) MarshalTo(dAtA []byte) (int, error)
- func (m *MessageValidation) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MessageValidation) ProtoMessage()
- func (m *MessageValidation) Reset()
- func (m *MessageValidation) Size() (n int)
- func (m *MessageValidation) String() string
- func (m *MessageValidation) Unmarshal(dAtA []byte) error
- func (m *MessageValidation) XXX_DiscardUnknown()
- func (m *MessageValidation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MessageValidation) XXX_Merge(src proto.Message)
- func (m *MessageValidation) XXX_Size() int
- func (m *MessageValidation) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthValidation = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowValidation = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupValidation = fmt.Errorf("proto: unexpected end of group") )
View Source
var E_Field = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*FieldValidation)(nil), Field: 61032, Name: "validation.field", Tag: "bytes,61032,opt,name=field", Filename: "validation.proto", }
View Source
var E_Message = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*MessageValidation)(nil), Field: 61032, Name: "validation.message", Tag: "bytes,61032,opt,name=message", Filename: "validation.proto", }
Functions ¶
This section is empty.
Types ¶
type FieldValidation ¶
type FieldValidation struct { // string options // if value is defined, it can not be "" NotEmptyString *bool `protobuf:"varint,1,opt,name=not_empty_string,json=notEmptyString" json:"not_empty_string,omitempty"` // the value has to be exactly this Matches *string `protobuf:"bytes,2,opt,name=matches" json:"matches,omitempty"` // the value must contain this substring Contains *string `protobuf:"bytes,3,opt,name=contains" json:"contains,omitempty"` // the value must match this regex Regex *string `protobuf:"bytes,4,opt,name=regex" json:"regex,omitempty"` // integer options // value must be less than or equal to this IntLte *int64 `protobuf:"varint,5,opt,name=int_lte,json=intLte" json:"int_lte,omitempty"` // value must be greater than or equal to this IntGte *int64 `protobuf:"varint,6,opt,name=int_gte,json=intGte" json:"int_gte,omitempty"` // value must equal this IntEq *int64 `protobuf:"varint,7,opt,name=int_eq,json=intEq" json:"int_eq,omitempty"` // floating point type options // value must be less than or equal to this FloatLte *float64 `protobuf:"fixed64,8,opt,name=float_lte,json=floatLte" json:"float_lte,omitempty"` // value must be greater than or equal to this FloatGte *float64 `protobuf:"fixed64,9,opt,name=float_gte,json=floatGte" json:"float_gte,omitempty"` // value must equal this FloatEq *float64 `protobuf:"fixed64,10,opt,name=float_eq,json=floatEq" json:"float_eq,omitempty"` // more string options // value must be at least this long MinLen *int64 `protobuf:"varint,11,opt,name=min_len,json=minLen" json:"min_len,omitempty"` // value must be at most this long MaxLen *int64 `protobuf:"varint,12,opt,name=max_len,json=maxLen" json:"max_len,omitempty"` // value must be exactly this long EqLen *int64 `protobuf:"varint,13,opt,name=eq_len,json=eqLen" json:"eq_len,omitempty"` // common option - define an error message instead of the default // {field} and {value} can be used as placeholders and will be replaced with the actual values Error *string `protobuf:"bytes,14,opt,name=error" json:"error,omitempty"` // more strings // validate using github.com/google/uuid that this is an actual uuid IsUuid *bool `protobuf:"varint,15,opt,name=is_uuid,json=isUuid" json:"is_uuid,omitempty"` // validate using net/mail ParseAddress that this is a valid email IsEmail *bool `protobuf:"varint,16,opt,name=is_email,json=isEmail" json:"is_email,omitempty"` // validate using time.Parse that this is a valid date using the default format of YYYY-MM-DD (2006-01-02 in go's // crazy syntax) IsIso8601Date *bool `protobuf:"varint,17,opt,name=is_iso8601_date,json=isIso8601Date" json:"is_iso8601_date,omitempty"` // use strings.Trim to trim whitespace from the value Trim *bool `protobuf:"varint,18,opt,name=trim" json:"trim,omitempty"` // use strings.ToLower before validating Lc *bool `protobuf:"varint,19,opt,name=lc" json:"lc,omitempty"` // use strings.ToUpper before validating Uc *bool `protobuf:"varint,20,opt,name=uc" json:"uc,omitempty"` // common option - a function name that you presumably defined in the same package space as the // code we generate that will be called via m.Field = FuncName(m.Field) allowing for any custom transformation TransformFunc *string `protobuf:"bytes,21,opt,name=transform_func,json=transformFunc" json:"transform_func,omitempty"` // do not generate validation code for a field; field type may not be supported i.e. oneof DoNotValidate *string `protobuf:"bytes,22,opt,name=do_not_validate,json=doNotValidate" json:"do_not_validate,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FieldValidation) Descriptor ¶
func (*FieldValidation) Descriptor() ([]byte, []int)
func (*FieldValidation) GetContains ¶
func (m *FieldValidation) GetContains() string
func (*FieldValidation) GetDoNotValidate ¶
func (m *FieldValidation) GetDoNotValidate() string
func (*FieldValidation) GetEqLen ¶
func (m *FieldValidation) GetEqLen() int64
func (*FieldValidation) GetError ¶
func (m *FieldValidation) GetError() string
func (*FieldValidation) GetFloatEq ¶
func (m *FieldValidation) GetFloatEq() float64
func (*FieldValidation) GetFloatGte ¶
func (m *FieldValidation) GetFloatGte() float64
func (*FieldValidation) GetFloatLte ¶
func (m *FieldValidation) GetFloatLte() float64
func (*FieldValidation) GetIntEq ¶
func (m *FieldValidation) GetIntEq() int64
func (*FieldValidation) GetIntGte ¶
func (m *FieldValidation) GetIntGte() int64
func (*FieldValidation) GetIntLte ¶
func (m *FieldValidation) GetIntLte() int64
func (*FieldValidation) GetIsEmail ¶
func (m *FieldValidation) GetIsEmail() bool
func (*FieldValidation) GetIsIso8601Date ¶
func (m *FieldValidation) GetIsIso8601Date() bool
func (*FieldValidation) GetIsUuid ¶
func (m *FieldValidation) GetIsUuid() bool
func (*FieldValidation) GetLc ¶
func (m *FieldValidation) GetLc() bool
func (*FieldValidation) GetMatches ¶
func (m *FieldValidation) GetMatches() string
func (*FieldValidation) GetMaxLen ¶
func (m *FieldValidation) GetMaxLen() int64
func (*FieldValidation) GetMinLen ¶
func (m *FieldValidation) GetMinLen() int64
func (*FieldValidation) GetNotEmptyString ¶
func (m *FieldValidation) GetNotEmptyString() bool
func (*FieldValidation) GetRegex ¶
func (m *FieldValidation) GetRegex() string
func (*FieldValidation) GetTransformFunc ¶
func (m *FieldValidation) GetTransformFunc() string
func (*FieldValidation) GetTrim ¶
func (m *FieldValidation) GetTrim() bool
func (*FieldValidation) GetUc ¶
func (m *FieldValidation) GetUc() bool
func (*FieldValidation) Marshal ¶
func (m *FieldValidation) Marshal() (dAtA []byte, err error)
func (*FieldValidation) MarshalToSizedBuffer ¶
func (m *FieldValidation) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*FieldValidation) ProtoMessage ¶
func (*FieldValidation) ProtoMessage()
func (*FieldValidation) Reset ¶
func (m *FieldValidation) Reset()
func (*FieldValidation) Size ¶
func (m *FieldValidation) Size() (n int)
func (*FieldValidation) String ¶
func (m *FieldValidation) String() string
func (*FieldValidation) Unmarshal ¶
func (m *FieldValidation) Unmarshal(dAtA []byte) error
func (*FieldValidation) XXX_DiscardUnknown ¶
func (m *FieldValidation) XXX_DiscardUnknown()
func (*FieldValidation) XXX_Marshal ¶
func (m *FieldValidation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FieldValidation) XXX_Merge ¶
func (m *FieldValidation) XXX_Merge(src proto.Message)
func (*FieldValidation) XXX_Size ¶
func (m *FieldValidation) XXX_Size() int
func (*FieldValidation) XXX_Unmarshal ¶
func (m *FieldValidation) XXX_Unmarshal(b []byte) error
type MessageValidation ¶
type MessageValidation struct { // returns right away after the first error instead of the default of validating all fields ReturnOnError *bool `protobuf:"varint,1,opt,name=return_on_error,json=returnOnError" json:"return_on_error,omitempty"` // uses strings.Trim on all strings in this message TrimStrings *bool `protobuf:"varint,2,opt,name=trim_strings,json=trimStrings" json:"trim_strings,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MessageValidation) Descriptor ¶
func (*MessageValidation) Descriptor() ([]byte, []int)
func (*MessageValidation) GetReturnOnError ¶
func (m *MessageValidation) GetReturnOnError() bool
func (*MessageValidation) GetTrimStrings ¶
func (m *MessageValidation) GetTrimStrings() bool
func (*MessageValidation) Marshal ¶
func (m *MessageValidation) Marshal() (dAtA []byte, err error)
func (*MessageValidation) MarshalTo ¶
func (m *MessageValidation) MarshalTo(dAtA []byte) (int, error)
func (*MessageValidation) MarshalToSizedBuffer ¶
func (m *MessageValidation) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MessageValidation) ProtoMessage ¶
func (*MessageValidation) ProtoMessage()
func (*MessageValidation) Reset ¶
func (m *MessageValidation) Reset()
func (*MessageValidation) Size ¶
func (m *MessageValidation) Size() (n int)
func (*MessageValidation) String ¶
func (m *MessageValidation) String() string
func (*MessageValidation) Unmarshal ¶
func (m *MessageValidation) Unmarshal(dAtA []byte) error
func (*MessageValidation) XXX_DiscardUnknown ¶
func (m *MessageValidation) XXX_DiscardUnknown()
func (*MessageValidation) XXX_Marshal ¶
func (m *MessageValidation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MessageValidation) XXX_Merge ¶
func (m *MessageValidation) XXX_Merge(src proto.Message)
func (*MessageValidation) XXX_Size ¶
func (m *MessageValidation) XXX_Size() int
func (*MessageValidation) XXX_Unmarshal ¶
func (m *MessageValidation) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.