feat: add info endpoint for data as json format#81
Open
danistrebel wants to merge 11 commits intoGoogleCloudPlatform:masterfrom
Open
feat: add info endpoint for data as json format#81danistrebel wants to merge 11 commits intoGoogleCloudPlatform:masterfrom
danistrebel wants to merge 11 commits intoGoogleCloudPlatform:masterfrom
Conversation
JulienBreux
suggested changes
Jul 2, 2024
Member
JulienBreux
left a comment
There was a problem hiding this comment.
Awesome! It's a very good and useful proposition.
| http.HandleFunc("/info", func(w http.ResponseWriter, r *http.Request) { | ||
| w.Header().Set("Content-Type", "application/json") | ||
| encoder := json.NewEncoder(w) | ||
| encoder.SetIndent("", " ") |
Member
There was a problem hiding this comment.
Why do you want to use SetIndent on encoder? Just for cosmetic?
It's not better to use jq locally and keep json "compressed"?
Author
There was a problem hiding this comment.
Works for me. Removed the SetIndent.
…udPlatform#84) Bumps [github.com/cloudevents/sdk-go/v2](https://github.com/cloudevents/sdk-go) from 2.3.1 to 2.15.2. - [Release notes](https://github.com/cloudevents/sdk-go/releases) - [Commits](cloudevents/sdk-go@v2.3.1...v2.15.2) --- updated-dependencies: - dependency-name: github.com/cloudevents/sdk-go/v2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps golang from 1.21 to 1.22. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adam Ross <adamross@google.com>
…orm#88) * docs: update README struct and include hello-job * Update README.md: Clarify source code not containers in repo
The Continuous Deployment flow now allows to click the URL right away, so we can't assume the build has failed.
Member
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Statement
Current implementation mainly targets an HTML based UI demo.
In my experience this makes the following use cases less elegant to demo:
Proposal
Add
/infoendpoint that directly outputs the existing data struct without the HTML template.Demo
Service
Client
response
{ "Service": "foo", "Revision": "bar", "Project": "my-host", "Region": "europe-west1-d", "AuthenticatedEmail": "", "Color": "my-color" }