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"
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.
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.
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"
TilerUnion
. This the kind of "provider" in the "providers" slice returned bycmd/internal/register.Providers()
. One of these is "registered" for every "provider" in the config file.provider/postgis
is this kind of "provider." This kind of "provider" is "registered" only once and then cleaned up at program exit. Theproviders
map inprovider/provider.go
holds a set of this kind, although it is also translated into adriversList
byprovider.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.