Skip to content

Use shared protobufs from cc-structs where available - #3

Merged
Cody A. Ray (codyaray) merged 8 commits into
masterfrom
cc-structs
May 8, 2018
Merged

Use shared protobufs from cc-structs where available#3
Cody A. Ray (codyaray) merged 8 commits into
masterfrom
cc-structs

Conversation

@codyaray

@codyaray Cody A. Ray (codyaray) commented May 8, 2018

Copy link
Copy Markdown
Contributor

@confluentinc/caas

  • Data types (e.g., Connect Cluster object)
  • Request/response messages
  • API errors are now corev1.Errors
  • User and account objects stored in config file (could be filtered for certain keys)

I updated Sling to support custom decoders so we can decode the JSON protobuf messages. Here's the upstream PR. Until they merge it, I'm just using my branch.

Other bits:

  • Add nicer error messages for malformed tokens
  • Add nicer error messages for not yet implemented functionality
  • Refactor errors from http to shared package

@travisjeffery Travis Jeffery (travisjeffery) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we switch from sling to https://github.com/h2non/gentleman/? it'd be nice to have middleware support. we could've changed the response decoder and any other custom handling of the request/response via middleware. i don't think sling adds enough on net/http to make it worth it.

Comment thread shared/errors.go
return nil
}

func ConvertAPIError(err error) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can refactor this later and have it so we only have to define the errors in one place and then users can marshal the relevant message (human vs. system)

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