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

Packages reorganisation #226

Merged
merged 12 commits into from
Mar 29, 2022
Merged

Packages reorganisation #226

merged 12 commits into from
Mar 29, 2022

Conversation

guicassolato
Copy link
Collaborator

@guicassolato guicassolato commented Feb 28, 2022

Reorganisation of /pkg

Before After
pkg/common.auth pkg/auth
pkg/common/auth_credentials pkg/auth
pkg/common/auth/mocks/http_mocks pkg/httptest
pkg/common.json pkg/json
pkg/common/log pkg/log
pkg/common.CheckContext pkg/context
pkg/common.FetchEnv main.go#fetchEnv
pkg/config pkg/evaluators
pkg/config#APIConfig pkg/evaluators#AuthConfig
pkg/cron pkg/workers
  • Always import “github.com/kuadrant/authorino/api/v1beta1" as “api”
  • Remove missing creds log error

@guicassolato guicassolato self-assigned this Feb 28, 2022
@guicassolato guicassolato force-pushed the pkg-rearrangement branch 2 times, most recently from 16bb01e to 6880b74 Compare March 26, 2022 10:55
@guicassolato guicassolato marked this pull request as ready for review March 28, 2022 17:40
@guicassolato
Copy link
Collaborator Author

Some offline discussion about the packages pkg/httptest and pkg/context. These are essentially abstractions (collections of helpers, really) for other Golang packages (net/http/httptest and context, respectively).

Stuffing those into a helpers package didn't feel right, precisely to avoid repeating a pattern this very PR is getting rid of, i.e. of having generic buckets like "others", "common" and "utils" where all the random stuff we do not know where to put end up going.

"Helpers" is somewhat more specific than the other examples mentioned here, but we decided to be conservative in this iteration, avoiding the generic buckets at all cost. We can always revisit this decision in the future in case we realise we exaggerated by specialising too much and not grouping enough.

@guicassolato guicassolato merged commit 353164f into main Mar 29, 2022
@guicassolato guicassolato deleted the pkg-rearrangement branch March 29, 2022 16:30
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