|
| 1 | +package api |
| 2 | + |
| 3 | +// Route is the structure of an app's route. |
| 4 | +type Route struct { |
| 5 | + // Owner is the app owner. It cannot be updated with AppSettings.Set(). See app.Transfer(). |
| 6 | + Owner string `json:"owner,omitempty"` |
| 7 | + // App is the app name. It cannot be updated at all right now. |
| 8 | + App string `json:"app,omitempty"` |
| 9 | + // Created is the time that the application settings was created and cannot be updated. |
| 10 | + Created string `json:"created,omitempty"` |
| 11 | + // Updated is the last time the application settings was changed and cannot be updated. |
| 12 | + Updated string `json:"updated,omitempty"` |
| 13 | + // UUID is a unique string reflecting the application settings in its current state. |
| 14 | + // It changes every time the application settings is changed and cannot be updated. |
| 15 | + UUID string `json:"uuid,omitempty"` |
| 16 | + Name string `json:"name,omitempty"` |
| 17 | + Type string `json:"procfile_type,omitempty"` |
| 18 | + Kind string `json:"kind,omitempty"` |
| 19 | + Port int `json:"port,omitempty"` |
| 20 | + ParentRefs []ParentRef `json:"parent_refs,omitempty"` |
| 21 | +} |
| 22 | + |
| 23 | +type ParentRef struct { |
| 24 | + Name string `json:"name,omitempty"` |
| 25 | + Port int `json:"port,omitempty"` |
| 26 | +} |
| 27 | + |
| 28 | +// // Routes defines a collection of Route objects. |
| 29 | +type Routes []Route |
| 30 | + |
| 31 | +// RouteCreateRequest is the structure of POST /v2/app/<app id>/routes/. |
| 32 | +type RouteCreateRequest struct { |
| 33 | + Name string `json:"name,omitempty"` |
| 34 | + Type string `json:"procfile_type,omitempty"` |
| 35 | + Port int `json:"port,omitempty"` |
| 36 | + Kind string `json:"kind,omitempty"` |
| 37 | +} |
| 38 | + |
| 39 | +// RouteAttackRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/attach/?$. |
| 40 | +type RouteAttackRequest struct { |
| 41 | + Port int `json:"port,omitempty"` |
| 42 | + Gateway string `json:"gateway,omitempty"` |
| 43 | +} |
| 44 | + |
| 45 | +// RouteDetackRequest is the structure of PATCH /v2/apps/(?P<id>{})/routes/(?P<name>{})/detach/?$. |
| 46 | +type RouteDetackRequest struct { |
| 47 | + Port int `json:"port,omitempty"` |
| 48 | + Gateway string `json:"gateway,omitempty"` |
| 49 | +} |
| 50 | + |
| 51 | +// RouteRule is the structure of GET RESPONSE /v2/apps/(?P<id>{})/routes/(?P<name>{})/rules/?$. |
| 52 | +type RouteRule struct { |
| 53 | + Name string `json:"name,omitempty"` |
| 54 | + Type string `json:"procfile_type,omitempty"` |
| 55 | + Kind string `json:"kind,omitempty"` |
| 56 | + Rules interface{} `json:"rules,omitempty"` |
| 57 | +} |
0 commit comments