This repository has been archived by the owner on Oct 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
types.go
84 lines (69 loc) · 2.63 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package edge
import "github.com/atlassian/voyager"
// ServiceDescriptor resource spec
type Spec struct {
UpstreamAddresses []UpstreamAddress `json:"upstreamAddresses"`
UpstreamPort int32 `json:"upstreamPort,omitempty"`
UpstreamSuffix string `json:"upstreamSuffix,omitempty"`
UpstreamOnly string `json:"upstreamOnly,omitempty"`
Domains []string `json:"domains,omitempty"`
Healthcheck string `json:"healthcheck,omitempty"`
Rewrite string `json:"rewrite,omitempty"`
Routes []Route `json:"routes,omitempty"`
}
type UpstreamAddress struct {
Address string `json:"address"`
Region voyager.Region `json:"region,omitempty"`
}
type Route struct {
Match RouteMatch `json:"match,omitempty"`
Route RouteAction `json:"route,omitempty"`
Redirect string `json:"redirect,omitempty"`
}
type RouteMatch struct {
Prefix string `json:"prefix,omitempty"`
Regex string `json:"regex,omitempty"`
Path string `json:"path,omitempty"`
Host string `json:"host,omitempty"`
}
type RouteAction struct {
Cluster string `json:"cluster"`
PrefixRewrite string `json:"prefixRewrite,omitempty"`
}
// OSB parameters
type osbInstanceParameters struct {
ServiceName voyager.ServiceName `json:"serviceName"`
Resource osbResourceParameters `json:"resource"`
}
type osbResourceParameters struct {
Attributes osbAttributes `json:"attributes"`
}
type osbAttributes struct {
UpstreamAddress []osbUpstreamAddress `json:"upstream_address"`
UpstreamPort int32 `json:"upstream_port,omitempty"`
UpstreamSuffix string `json:"upstream_suffix,omitempty"`
UpstreamOnly string `json:"upstream_only,omitempty"`
Domain []string `json:"domain,omitempty"`
Healthcheck string `json:"healthcheck,omitempty"`
Rewrite string `json:"rewrite,omitempty"`
Routes []osbRoute `json:"routes,omitempty"`
}
type osbUpstreamAddress struct {
Address string `json:"address"`
Region voyager.Region `json:"region,omitempty"`
}
type osbRoute struct {
Match osbRouteMatch `json:"match,omitempty"`
Route osbRouteAction `json:"route,omitempty"`
Redirect string `json:"redirect,omitempty"`
}
type osbRouteMatch struct {
Prefix string `json:"prefix,omitempty"`
Regex string `json:"regex,omitempty"`
Path string `json:"path,omitempty"`
Host string `json:"host,omitempty"`
}
type osbRouteAction struct {
Cluster string `json:"cluster"`
PrefixRewrite string `json:"prefix_rewrite,omitempty"`
}