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

Add the discovery flag and method, along with model package #2

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

rliddler
Copy link
Contributor

We want to be able to output schemas when we run in discovery mode so this PR adds that flag along with the associated method to do so.

It just goes through the streams and calls Schema() along with adding a few other fields. In the future we will also need to generate metadata as part of that (and consume the file back in).

The other change here is the start of pulling out the models we use to generate schemas and serialize data into their own package.

This PR just pulls out the schema itself - but a followup will add a bunch of models representing entities in our API that we expose. Will just follow a simple pattern of having a schema / serialize method on them.

@@ -113,3 +70,17 @@ func (o *OutputLogger) Log(op *Output) error {

return nil
}

func (o *OutputLogger) CataLog(catalog *Catalog) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func (o *OutputLogger) CataLog(catalog *Catalog) error {
func (o *OutputLogger) Catalog(catalog *Catalog) error {

..?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a terrible joke from me - it's a catalog log 😢

We want to be able to output schemas when we run in discovery mode so
this PR adds that flag along with the associated method to do so.

It just goes through the streams and calls Schema() along with adding a
few other fields. In the future we will also need to generate metadata
as part of that (and consume the file back in).

The other change here is the start of pulling out the models we use to
generate schemas and serialize data into their own package.

This PR just pulls out the schema itself - but a followup will add a
bunch of models representing entities in our API that we expose. Will
just follow a simple pattern of having a schema / serialize method on
them.
@rliddler rliddler force-pushed the rob/add-discovery-mode-and-model-basics branch from 86ce907 to 01e72ec Compare October 18, 2023 09:32
@rliddler rliddler merged commit 413c5c4 into master Oct 18, 2023
@rliddler rliddler deleted the rob/add-discovery-mode-and-model-basics branch October 18, 2023 09:34
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