-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparameters.go
32 lines (26 loc) · 1.05 KB
/
parameters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package reflect
// Different operations to match parameters with.
type ParameterOperation string
const (
EqualsOperation = ParameterOperation("=")
NotEqualsOperation = ParameterOperation("!=")
GreaterThanOperation = ParameterOperation(">")
GreaterThanOrEqualsOperation = ParameterOperation(">=")
LessThanOperation = ParameterOperation("<")
LessThanOrEqualsOperation = ParameterOperation("<=")
ContainsOperation = ParameterOperation("=~")
NotContainsOperation = ParameterOperation("!~")
)
// A parameter you want to include when generating signed authentication tokens
// for your clients.
type Parameter struct {
// The name of the field this parameter applies to.
Field string `json:"field"`
// The operation to apply to this field and value.
Op ParameterOperation `json:"op"`
// The value to compare against.
Value string `json:"value"`
// A slice of possible values to compare against, any of which will be
// considered in the operation specified.
AnyValues []string `json:"any"`
}