Closed ARolek closed 3 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
server/handle_map_style.go | 7 | 8 | 87.5% | ||
server/handle_capabilities.go | 26 | 28 | 92.86% | ||
server/server.go | 5 | 7 | 71.43% | ||
cmd/tegola_lambda/main.go | 0 | 3 | 0.0% | ||
server/errors.go | 0 | 3 | 0.0% | ||
cmd/tegola/cmd/server.go | 0 | 4 | 0.0% | ||
internal/env/parse.go | 9 | 13 | 69.23% | ||
internal/env/types.go | 10 | 16 | 62.5% | ||
server/tile_url_template.go | 69 | 77 | 89.61% | ||
config/errors.go | 0 | 11 | 0.0% | ||
<!-- | Total: | 145 | 189 | 76.72% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
cmd/tegola_lambda/main.go | 1 | 0.0% | ||
<!-- | Total: | 1 | --> |
Totals | |
---|---|
Change from base Build a58cd8965: | 0.3% |
Covered Lines: | 7030 |
Relevant Lines: | 16419 |
I took some time to test this out and seems to function as advertised. Look forward to it's commit bit
@gdey / @iwpnd I have added another commit which implemented a new config type: env.URL
. This removes the need for the URL parsing to happen at latter stages. I have tagged you two for re-review when you have a min.
Though this PR has a lot of code changes, a lot of them are clean up, adding consts, and formatting. The material changes are as follows:
buildCapabilitiesURL
from the server package. This function was handling too many cases and brittle./{z}/{x}/{y}.pbf
uri template suffix will now use this type.hostname
attribute does not support a protocol, but sometimes the protocol was configured and it would result in malformed URLs (#994). The validation and use of the url.URL package helps work with user supplied URLs.Overall, it's a lot of code, but I got frustrated with the state of things and deemed a refactor necessary.