Documentation
¶
Index ¶
- Variables
- func CallValidatorIfExists(candidate interface{}) error
- func FieldError(fieldName string, err error) error
- type DoubleValue
- func (*DoubleValue) Descriptor() ([]byte, []int)
- func (m *DoubleValue) GetValue() float64
- func (*DoubleValue) ProtoMessage()
- func (m *DoubleValue) Reset()
- func (m *DoubleValue) String() string
- func (m *DoubleValue) XXX_DiscardUnknown()
- func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DoubleValue) XXX_Merge(src proto.Message)
- func (m *DoubleValue) XXX_Size() int
- func (m *DoubleValue) XXX_Unmarshal(b []byte) error
- type FieldValidator
- func (*FieldValidator) Descriptor() ([]byte, []int)
- func (m *FieldValidator) GetFloatEpsilon() *DoubleValue
- func (m *FieldValidator) GetFloatGt() *DoubleValue
- func (m *FieldValidator) GetFloatGte() *DoubleValue
- func (m *FieldValidator) GetFloatLt() *DoubleValue
- func (m *FieldValidator) GetFloatLte() *DoubleValue
- func (m *FieldValidator) GetHumanError() string
- func (m *FieldValidator) GetIntGt() *Int64Value
- func (m *FieldValidator) GetIntLt() *Int64Value
- func (m *FieldValidator) GetIsInEnum() bool
- func (m *FieldValidator) GetLengthEq() *Int64Value
- func (m *FieldValidator) GetLengthGt() *Int64Value
- func (m *FieldValidator) GetLengthLt() *Int64Value
- func (m *FieldValidator) GetMsgExists() bool
- func (m *FieldValidator) GetOnesignalUuidV1() bool
- func (m *FieldValidator) GetRegex() *StringValue
- func (m *FieldValidator) GetRepeatedCountMax() *Int64Value
- func (m *FieldValidator) GetRepeatedCountMin() *Int64Value
- func (m *FieldValidator) GetStringNotEmpty() bool
- func (m *FieldValidator) GetUuidVer() *Int32Value
- func (*FieldValidator) ProtoMessage()
- func (m *FieldValidator) Reset()
- func (m *FieldValidator) String() string
- func (m *FieldValidator) XXX_DiscardUnknown()
- func (m *FieldValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FieldValidator) XXX_Merge(src proto.Message)
- func (m *FieldValidator) XXX_Size() int
- func (m *FieldValidator) XXX_Unmarshal(b []byte) error
- type Int32Value
- func (*Int32Value) Descriptor() ([]byte, []int)
- func (m *Int32Value) GetValue() int32
- func (*Int32Value) ProtoMessage()
- func (m *Int32Value) Reset()
- func (m *Int32Value) String() string
- func (m *Int32Value) XXX_DiscardUnknown()
- func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Int32Value) XXX_Merge(src proto.Message)
- func (m *Int32Value) XXX_Size() int
- func (m *Int32Value) XXX_Unmarshal(b []byte) error
- type Int64Value
- func (*Int64Value) Descriptor() ([]byte, []int)
- func (m *Int64Value) GetValue() int64
- func (*Int64Value) ProtoMessage()
- func (m *Int64Value) Reset()
- func (m *Int64Value) String() string
- func (m *Int64Value) XXX_DiscardUnknown()
- func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Int64Value) XXX_Merge(src proto.Message)
- func (m *Int64Value) XXX_Size() int
- func (m *Int64Value) XXX_Unmarshal(b []byte) error
- type OneofValidator
- func (*OneofValidator) Descriptor() ([]byte, []int)
- func (m *OneofValidator) GetRequired() bool
- func (*OneofValidator) ProtoMessage()
- func (m *OneofValidator) Reset()
- func (m *OneofValidator) String() string
- func (m *OneofValidator) XXX_DiscardUnknown()
- func (m *OneofValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *OneofValidator) XXX_Merge(src proto.Message)
- func (m *OneofValidator) XXX_Size() int
- func (m *OneofValidator) XXX_Unmarshal(b []byte) error
- type StringValue
- func (*StringValue) Descriptor() ([]byte, []int)
- func (m *StringValue) GetValue() string
- func (*StringValue) ProtoMessage()
- func (m *StringValue) Reset()
- func (m *StringValue) String() string
- func (m *StringValue) XXX_DiscardUnknown()
- func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StringValue) XXX_Merge(src proto.Message)
- func (m *StringValue) XXX_Size() int
- func (m *StringValue) XXX_Unmarshal(b []byte) error
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var E_Field = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*FieldValidator)(nil), Field: 65020, Name: "validator.field", Tag: "bytes,65020,opt,name=field", Filename: "validator.proto", }
View Source
var E_Oneof = &proto.ExtensionDesc{ ExtendedType: (*descriptor.OneofOptions)(nil), ExtensionType: (*OneofValidator)(nil), Field: 65021, Name: "validator.oneof", Tag: "bytes,65021,opt,name=oneof", Filename: "validator.proto", }
Functions ¶
func CallValidatorIfExists ¶
func CallValidatorIfExists(candidate interface{}) error
func FieldError ¶
FieldError wraps a given Validator error providing a message call stack.
Types ¶
type DoubleValue ¶ added in v0.4.0
type DoubleValue struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DoubleValue) Descriptor ¶ added in v0.4.0
func (*DoubleValue) Descriptor() ([]byte, []int)
func (*DoubleValue) GetValue ¶ added in v0.4.0
func (m *DoubleValue) GetValue() float64
func (*DoubleValue) ProtoMessage ¶ added in v0.4.0
func (*DoubleValue) ProtoMessage()
func (*DoubleValue) Reset ¶ added in v0.4.0
func (m *DoubleValue) Reset()
func (*DoubleValue) String ¶ added in v0.4.0
func (m *DoubleValue) String() string
func (*DoubleValue) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *DoubleValue) XXX_DiscardUnknown()
func (*DoubleValue) XXX_Marshal ¶ added in v0.4.0
func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DoubleValue) XXX_Merge ¶ added in v0.4.0
func (m *DoubleValue) XXX_Merge(src proto.Message)
func (*DoubleValue) XXX_Size ¶ added in v0.4.0
func (m *DoubleValue) XXX_Size() int
func (*DoubleValue) XXX_Unmarshal ¶ added in v0.4.0
func (m *DoubleValue) XXX_Unmarshal(b []byte) error
type FieldValidator ¶
type FieldValidator struct { // Uses a Golang RE2-syntax regex to match the field contents. Regex *StringValue `protobuf:"bytes,1,opt,name=regex,proto3" json:"regex,omitempty"` // Field value of integer strictly greater than this value. IntGt *Int64Value `protobuf:"bytes,2,opt,name=int_gt,json=intGt,proto3" json:"int_gt,omitempty"` // Field value of integer strictly smaller than this value. IntLt *Int64Value `protobuf:"bytes,3,opt,name=int_lt,json=intLt,proto3" json:"int_lt,omitempty"` // Used for nested message types, requires that the message type exists. MsgExists bool `protobuf:"varint,4,opt,name=msg_exists,json=msgExists,proto3" json:"msg_exists,omitempty"` // Human error specifies a user-customizable error that is visible to the user. HumanError string `protobuf:"bytes,5,opt,name=human_error,json=humanError,proto3" json:"human_error,omitempty"` // Field value of double strictly greater than this value. // Note that this value can only take on a valid floating point // value. Use together with float_epsilon if you need something more specific. FloatGt *DoubleValue `protobuf:"bytes,6,opt,name=float_gt,json=floatGt,proto3" json:"float_gt,omitempty"` // Field value of double strictly smaller than this value. // Note that this value can only take on a valid floating point // value. Use together with float_epsilon if you need something more specific. FloatLt *DoubleValue `protobuf:"bytes,7,opt,name=float_lt,json=floatLt,proto3" json:"float_lt,omitempty"` // Field value of double describing the epsilon within which // any comparison should be considered to be true. For example, // when using float_gt = 0.35, using a float_epsilon of 0.05 // would mean that any value above 0.30 is acceptable. It can be // thought of as a {float_value_condition} +- {float_epsilon}. // If unset, no correction for floating point inaccuracies in // comparisons will be attempted. FloatEpsilon *DoubleValue `protobuf:"bytes,8,opt,name=float_epsilon,json=floatEpsilon,proto3" json:"float_epsilon,omitempty"` // Floating-point value compared to which the field content should be greater or equal. FloatGte *DoubleValue `protobuf:"bytes,9,opt,name=float_gte,json=floatGte,proto3" json:"float_gte,omitempty"` // Floating-point value compared to which the field content should be smaller or equal. FloatLte *DoubleValue `protobuf:"bytes,10,opt,name=float_lte,json=floatLte,proto3" json:"float_lte,omitempty"` // Used for string fields, requires the string to be not empty (i.e different from ""). StringNotEmpty bool `protobuf:"varint,11,opt,name=string_not_empty,json=stringNotEmpty,proto3" json:"string_not_empty,omitempty"` // Repeated field with at least this number of elements. RepeatedCountMin *Int64Value `protobuf:"bytes,12,opt,name=repeated_count_min,json=repeatedCountMin,proto3" json:"repeated_count_min,omitempty"` // Repeated field with at most this number of elements. RepeatedCountMax *Int64Value `protobuf:"bytes,13,opt,name=repeated_count_max,json=repeatedCountMax,proto3" json:"repeated_count_max,omitempty"` // Field value of length greater than this value. LengthGt *Int64Value `protobuf:"bytes,14,opt,name=length_gt,json=lengthGt,proto3" json:"length_gt,omitempty"` // Field value of length smaller than this value. LengthLt *Int64Value `protobuf:"bytes,15,opt,name=length_lt,json=lengthLt,proto3" json:"length_lt,omitempty"` // Field value of length strictly equal to this value. LengthEq *Int64Value `protobuf:"bytes,16,opt,name=length_eq,json=lengthEq,proto3" json:"length_eq,omitempty"` // Requires that the value is in the enum. IsInEnum bool `protobuf:"varint,17,opt,name=is_in_enum,json=isInEnum,proto3" json:"is_in_enum,omitempty"` // Ensures that a string value is in UUID format. // uuid_ver specifies the valid UUID versions. Valid values are: 0-5. // If uuid_ver is 0 all UUID versions are accepted. UuidVer *Int32Value `protobuf:"bytes,18,opt,name=uuid_ver,json=uuidVer,proto3" json:"uuid_ver,omitempty"` // Ensure that OneSignal's internal UUID wrapper `uuid.v1.UUID` contains a valid UUID OnesignalUuidV1 bool `protobuf:"varint,19,opt,name=onesignal_uuid_v1,json=onesignalUuidV1,proto3" json:"onesignal_uuid_v1,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FieldValidator) Descriptor ¶
func (*FieldValidator) Descriptor() ([]byte, []int)
func (*FieldValidator) GetFloatEpsilon ¶
func (m *FieldValidator) GetFloatEpsilon() *DoubleValue
func (*FieldValidator) GetFloatGt ¶
func (m *FieldValidator) GetFloatGt() *DoubleValue
func (*FieldValidator) GetFloatGte ¶
func (m *FieldValidator) GetFloatGte() *DoubleValue
func (*FieldValidator) GetFloatLt ¶
func (m *FieldValidator) GetFloatLt() *DoubleValue
func (*FieldValidator) GetFloatLte ¶
func (m *FieldValidator) GetFloatLte() *DoubleValue
func (*FieldValidator) GetHumanError ¶
func (m *FieldValidator) GetHumanError() string
func (*FieldValidator) GetIntGt ¶
func (m *FieldValidator) GetIntGt() *Int64Value
func (*FieldValidator) GetIntLt ¶
func (m *FieldValidator) GetIntLt() *Int64Value
func (*FieldValidator) GetIsInEnum ¶
func (m *FieldValidator) GetIsInEnum() bool
func (*FieldValidator) GetLengthEq ¶
func (m *FieldValidator) GetLengthEq() *Int64Value
func (*FieldValidator) GetLengthGt ¶
func (m *FieldValidator) GetLengthGt() *Int64Value
func (*FieldValidator) GetLengthLt ¶
func (m *FieldValidator) GetLengthLt() *Int64Value
func (*FieldValidator) GetMsgExists ¶
func (m *FieldValidator) GetMsgExists() bool
func (*FieldValidator) GetOnesignalUuidV1 ¶
func (m *FieldValidator) GetOnesignalUuidV1() bool
func (*FieldValidator) GetRegex ¶
func (m *FieldValidator) GetRegex() *StringValue
func (*FieldValidator) GetRepeatedCountMax ¶
func (m *FieldValidator) GetRepeatedCountMax() *Int64Value
func (*FieldValidator) GetRepeatedCountMin ¶
func (m *FieldValidator) GetRepeatedCountMin() *Int64Value
func (*FieldValidator) GetStringNotEmpty ¶
func (m *FieldValidator) GetStringNotEmpty() bool
func (*FieldValidator) GetUuidVer ¶
func (m *FieldValidator) GetUuidVer() *Int32Value
func (*FieldValidator) ProtoMessage ¶
func (*FieldValidator) ProtoMessage()
func (*FieldValidator) Reset ¶
func (m *FieldValidator) Reset()
func (*FieldValidator) String ¶
func (m *FieldValidator) String() string
func (*FieldValidator) XXX_DiscardUnknown ¶
func (m *FieldValidator) XXX_DiscardUnknown()
func (*FieldValidator) XXX_Marshal ¶
func (m *FieldValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FieldValidator) XXX_Merge ¶
func (m *FieldValidator) XXX_Merge(src proto.Message)
func (*FieldValidator) XXX_Size ¶
func (m *FieldValidator) XXX_Size() int
func (*FieldValidator) XXX_Unmarshal ¶
func (m *FieldValidator) XXX_Unmarshal(b []byte) error
type Int32Value ¶ added in v0.4.0
type Int32Value struct { Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Int32Value) Descriptor ¶ added in v0.4.0
func (*Int32Value) Descriptor() ([]byte, []int)
func (*Int32Value) GetValue ¶ added in v0.4.0
func (m *Int32Value) GetValue() int32
func (*Int32Value) ProtoMessage ¶ added in v0.4.0
func (*Int32Value) ProtoMessage()
func (*Int32Value) Reset ¶ added in v0.4.0
func (m *Int32Value) Reset()
func (*Int32Value) String ¶ added in v0.4.0
func (m *Int32Value) String() string
func (*Int32Value) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *Int32Value) XXX_DiscardUnknown()
func (*Int32Value) XXX_Marshal ¶ added in v0.4.0
func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Int32Value) XXX_Merge ¶ added in v0.4.0
func (m *Int32Value) XXX_Merge(src proto.Message)
func (*Int32Value) XXX_Size ¶ added in v0.4.0
func (m *Int32Value) XXX_Size() int
func (*Int32Value) XXX_Unmarshal ¶ added in v0.4.0
func (m *Int32Value) XXX_Unmarshal(b []byte) error
type Int64Value ¶ added in v0.4.0
type Int64Value struct { Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Int64Value) Descriptor ¶ added in v0.4.0
func (*Int64Value) Descriptor() ([]byte, []int)
func (*Int64Value) GetValue ¶ added in v0.4.0
func (m *Int64Value) GetValue() int64
func (*Int64Value) ProtoMessage ¶ added in v0.4.0
func (*Int64Value) ProtoMessage()
func (*Int64Value) Reset ¶ added in v0.4.0
func (m *Int64Value) Reset()
func (*Int64Value) String ¶ added in v0.4.0
func (m *Int64Value) String() string
func (*Int64Value) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *Int64Value) XXX_DiscardUnknown()
func (*Int64Value) XXX_Marshal ¶ added in v0.4.0
func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Int64Value) XXX_Merge ¶ added in v0.4.0
func (m *Int64Value) XXX_Merge(src proto.Message)
func (*Int64Value) XXX_Size ¶ added in v0.4.0
func (m *Int64Value) XXX_Size() int
func (*Int64Value) XXX_Unmarshal ¶ added in v0.4.0
func (m *Int64Value) XXX_Unmarshal(b []byte) error
type OneofValidator ¶
type OneofValidator struct { // Require that one of the oneof fields is set. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*OneofValidator) Descriptor ¶
func (*OneofValidator) Descriptor() ([]byte, []int)
func (*OneofValidator) GetRequired ¶
func (m *OneofValidator) GetRequired() bool
func (*OneofValidator) ProtoMessage ¶
func (*OneofValidator) ProtoMessage()
func (*OneofValidator) Reset ¶
func (m *OneofValidator) Reset()
func (*OneofValidator) String ¶
func (m *OneofValidator) String() string
func (*OneofValidator) XXX_DiscardUnknown ¶
func (m *OneofValidator) XXX_DiscardUnknown()
func (*OneofValidator) XXX_Marshal ¶
func (m *OneofValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*OneofValidator) XXX_Merge ¶
func (m *OneofValidator) XXX_Merge(src proto.Message)
func (*OneofValidator) XXX_Size ¶
func (m *OneofValidator) XXX_Size() int
func (*OneofValidator) XXX_Unmarshal ¶
func (m *OneofValidator) XXX_Unmarshal(b []byte) error
type StringValue ¶ added in v0.4.0
type StringValue struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StringValue) Descriptor ¶ added in v0.4.0
func (*StringValue) Descriptor() ([]byte, []int)
func (*StringValue) GetValue ¶ added in v0.4.0
func (m *StringValue) GetValue() string
func (*StringValue) ProtoMessage ¶ added in v0.4.0
func (*StringValue) ProtoMessage()
func (*StringValue) Reset ¶ added in v0.4.0
func (m *StringValue) Reset()
func (*StringValue) String ¶ added in v0.4.0
func (m *StringValue) String() string
func (*StringValue) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *StringValue) XXX_DiscardUnknown()
func (*StringValue) XXX_Marshal ¶ added in v0.4.0
func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StringValue) XXX_Merge ¶ added in v0.4.0
func (m *StringValue) XXX_Merge(src proto.Message)
func (*StringValue) XXX_Size ¶ added in v0.4.0
func (m *StringValue) XXX_Size() int
func (*StringValue) XXX_Unmarshal ¶ added in v0.4.0
func (m *StringValue) XXX_Unmarshal(b []byte) error
Directories
¶
Path | Synopsis |
---|---|
The validator plugin generates a Validate method for each message.
|
The validator plugin generates a Validate method for each message. |
Click to show internal directories.
Click to hide internal directories.