-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathroutes.go
More file actions
61 lines (51 loc) · 2.14 KB
/
routes.go
File metadata and controls
61 lines (51 loc) · 2.14 KB
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
package api
// Route is the structure of an app's route.
type Route struct {
// Owner is the app owner. It cannot be updated with AppSettings.Set(). See app.Transfer().
Owner string `json:"owner,omitempty"`
// App is the app name. It cannot be updated at all right now.
App string `json:"app,omitempty"`
// Created is the time that the application settings was created and cannot be updated.
Created string `json:"created,omitempty"`
// Updated is the last time the application settings was changed and cannot be updated.
Updated string `json:"updated,omitempty"`
// UUID is a unique string reflecting the application settings in its current state.
// It changes every time the application settings is changed and cannot be updated.
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Kind string `json:"kind,omitempty"`
ParentRefs []ParentRef `json:"parent_refs,omitempty"`
Rules []RouteRule `json:"rules,omitempty"`
}
type ParentRef struct {
Name string `json:"name,omitempty"`
Port int `json:"port,omitempty"`
}
type RouteRule map[string]interface{}
// Routes defines a collection of Route objects.
type Routes []Route
// RouteCreateRequest is the structure of POST /v2/app/<app_id>/routes/.
type RouteCreateRequest struct {
Name string `json:"name,omitempty"`
Kind string `json:"kind,omitempty"`
Rules []RequestRouteRule `json:"rules,omitempty"`
}
type BackendRefRequest struct {
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
Port int32 `json:"port,omitempty"`
Weight int32 `json:"weight,omitempty"`
}
type RequestRouteRule struct {
BackendRefs []BackendRefRequest `json:"backendRefs,omitempty"`
}
// RouteAttachRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/attach/?$.
type RouteAttachRequest struct {
Port int `json:"port,omitempty"`
Gateway string `json:"gateway,omitempty"`
}
// RouteDetachRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/detach/?$.
type RouteDetachRequest struct {
Port int `json:"port,omitempty"`
Gateway string `json:"gateway,omitempty"`
}