-
Notifications
You must be signed in to change notification settings - Fork 22
/
types.go
66 lines (56 loc) · 1.1 KB
/
types.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package processing
import (
v1beta1 "istio.io/api/networking/v1beta1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
type Action int
const (
create Action = iota
update
delete
)
func (s Action) String() string {
switch s {
case create:
return "create"
case update:
return "update"
case delete:
return "delete"
}
return "unknown"
}
type ObjectChange struct {
Action Action
Obj client.Object
}
func NewObjectCreateAction(obj client.Object) *ObjectChange {
return &ObjectChange{
Action: create,
Obj: obj,
}
}
func NewObjectUpdateAction(obj client.Object) *ObjectChange {
return &ObjectChange{
Action: update,
Obj: obj,
}
}
func NewObjectDeleteAction(obj client.Object) *ObjectChange {
return &ObjectChange{
Action: delete,
Obj: obj,
}
}
// CorsConfig is an internal representation of v1alpha3.CorsPolicy object
type CorsConfig struct {
AllowOrigins []*v1beta1.StringMatch
AllowMethods []string
AllowHeaders []string
}
type ReconciliationConfig struct {
OathkeeperSvc string
OathkeeperSvcPort uint32
CorsConfig *CorsConfig
DefaultDomainName string
}