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

Move api/types/client.go and api/types/backend to a more appropriate package #36337

Open
dnephin opened this issue Feb 16, 2018 · 3 comments
Open
Labels
area/api kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@dnephin
Copy link
Member

dnephin commented Feb 16, 2018

The api/types package should only contain the types used to serialize/deserialize requests and responses for the HTTP API. This is the case for most of the types in this package and sub packages.

There are two exceptions:

  • api/types/client.go contains types that are used by APIClient interface in the client package
  • api/types/backend contains types that are used by the backend interfaces between the API routers and the server implementation

These two categories of types are never used for serialization/deserialization.

I propose we move these types to a more appropriate place:

  • api/types/client.go should move to client/types
  • api/types/backend could be split up and moved to api/server/router/<component> or moved to api/server/backend/types

cc @tiborvass @vdemeester @cpuguy83

@tiborvass
Copy link
Contributor

@dnephin I'm fine with that. Thanks!

@cpuguy83
Copy link
Member

api/server/backend/types seems better than api/server/router/ since these are typically shared between the router and the backend.

client/types sounds great.

@thaJeztah thaJeztah added area/api kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Feb 19, 2018
@vdemeester vdemeester self-assigned this Apr 25, 2018
@vdemeester
Copy link
Member

Preparing a few PRs on that. Type aliases (go 1.9) is gonna help tremendously for not breaking people 👼

@vdemeester vdemeester removed their assignment Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests

5 participants