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

Cleanup "provider" and "register" terminology #953

Open
jchamberlain opened this issue Sep 12, 2023 · 0 comments
Open

Cleanup "provider" and "register" terminology #953

jchamberlain opened this issue Sep 12, 2023 · 0 comments

Comments

@jchamberlain
Copy link
Contributor

As a newcomer to the project, the mixed use of "provider" and "register" in the code base took me some time to grok.

Meanings of "Provider"

  1. A wrapper around some data resource, e.g., a specific PostGIS connection, with a list of layers available in this resource. For example, the "providers" section in the config file has this meaning. This is also referred to as a "Tiler", and its concrete type in common use is TilerUnion. This the kind of "provider" in the "providers" slice returned by cmd/internal/register.Providers(). One of these is "registered" for every "provider" in the config file.
  2. A driver which allows creating Tilers ("provider" definition 1) for a specific type of data resource. provider/postgis is this kind of "provider." This kind of "provider" is "registered" only once and then cleaned up at program exit. The providers map in provider/provider.go holds a set of this kind, although it is also translated into a driversList by provider.Drivers().

Meanings of "Register"

I found the usage of "register" also confusing, but primarily because it refers to different "provider" definitions and lifecycles. There's a register package which has nothing (almost) to do with registering the type 2 "providers". If the context were more clear, the usage of "register" would probably clear up as well.

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

No branches or pull requests

1 participant