-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cog as library #422
Cog as library #422
Conversation
Note: in addition to the changes introduced by this PR, the diff includes unreleased changes living in
grafana-foundation-sdk@next+cog-v0.0.x |
b9f73ce
to
e53d49d
Compare
1070501
to
750a47c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some naming suggestions
**********/ | ||
|
||
// CUEValue sets the pipeline's input to the given cue value. | ||
func (pipeline *SchemaToTypesPipeline) CUEValue(pkgName string, value cue.Value, opts ...CUEOption) *SchemaToTypesPipeline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a builder, I'd expect a With...
here
func (pipeline *SchemaToTypesPipeline) CUEValue(pkgName string, value cue.Value, opts ...CUEOption) *SchemaToTypesPipeline { | |
func (pipeline *SchemaToTypesPipeline) WithCUEValue(pkgName string, value cue.Value, opts ...CUEOption) *SchemaToTypesPipeline { |
|
||
// SchemaTransformations adds the given transformations to the set of | ||
// transformations that will be applied to the input schema. | ||
func (pipeline *SchemaToTypesPipeline) SchemaTransformations(passes ...compiler.Pass) *SchemaToTypesPipeline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, about the With
func (pipeline *SchemaToTypesPipeline) SchemaTransformations(passes ...compiler.Pass) *SchemaToTypesPipeline { | |
func (pipeline *SchemaToTypesPipeline) WithSchemaTransformations(passes ...compiler.Pass) *SchemaToTypesPipeline { |
***********/ | ||
|
||
// Golang sets the output to Golang types. | ||
func (pipeline *SchemaToTypesPipeline) Golang() *SchemaToTypesPipeline { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (pipeline *SchemaToTypesPipeline) Golang() *SchemaToTypesPipeline { | |
func (pipeline *SchemaToTypesPipeline) WithGolangOutput() *SchemaToTypesPipeline { |
Maybe? Golang()
doesn't really tell me what this will do
This reverts commit 69a6d9f. This version of kin-openapi causes conflicts with tools that whish to depend on cog, such as grafana-app-sdk
9da3256
to
f399ae4
Compare
Contributes to #408
grafana-app-sdk
wants to rely on cog for some of its codegen-related use-cases, especially to generate Go and Typescript types from a single CUE value.This PR is a proposition of a minimal API that would allow
grafana-app-sdk
to use cog as a library to achieve these goals.A sandbox PR is open to see how it would look like on the other side of the fence: grafana/grafana-app-sdk#296