This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
"cf_on_k8s": true
into the /
response
Also introduce root response presenter and response type Issue: #10 Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
- Loading branch information
1 parent
e665429
commit 50b7e62
Showing
4 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package presenter | ||
|
||
type APILink struct { | ||
Link | ||
Meta APILinkMeta `json:"meta"` | ||
} | ||
|
||
type APILinkMeta struct { | ||
Version string `json:"version"` | ||
} | ||
|
||
type RootResponse struct { | ||
Links map[string]*APILink `json:"links"` | ||
CFOnK8s bool `json:"cf_on_k8s"` | ||
} | ||
|
||
func GetRootResponse(serverURL string) RootResponse { | ||
return RootResponse{ | ||
Links: map[string]*APILink{ | ||
"self": {Link: Link{HREF: serverURL}}, | ||
"bits_service": nil, | ||
"cloud_controller_v2": nil, | ||
"cloud_controller_v3": {Link: Link{HREF: serverURL + "/v3"}, Meta: APILinkMeta{Version: "3.90.0"}}, | ||
"network_policy_v0": nil, | ||
"network_policy_v1": nil, | ||
"login": nil, | ||
"uaa": nil, | ||
"credhub": nil, | ||
"routing": nil, | ||
"logging": nil, | ||
"log_cache": nil, | ||
"log_stream": nil, | ||
"app_ssh": nil, | ||
}, | ||
CFOnK8s: true, | ||
} | ||
} |