Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(examples): Adds http-keyvalue-crud component example #153

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ericgregory
Copy link
Contributor

Adds new http-keyvalue-crud component example.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
Signed-off-by: Eric Gregory <eric@cosmonic.com>
Signed-off-by: Eric Gregory <eric@cosmonic.com>
Signed-off-by: Eric Gregory <eric@cosmonic.com>
Signed-off-by: Eric Gregory <eric@cosmonic.com>
@ericgregory ericgregory requested a review from a team as a code owner January 10, 2025 20:49
Signed-off-by: Eric Gregory <eric@cosmonic.com>
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
Signed-off-by: Eric Gregory <eric@cosmonic.com>
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
examples/component/http-keyvalue-crud/main.go Outdated Show resolved Hide resolved
Signed-off-by: Eric Gregory <eric@cosmonic.com>
return
}
// Confirms that the key has been set.
fmt.Fprintf(w, "Set %s to %s\n", key, value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a nit rather than a hard requirement, it seems a bit strange to mix json and non-json responses from the component, ideally these would all be returned back to the user in a JSON envelope, even if it's a single field body:

{
    "message": "Set %s to %s"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants