protomaps / go-pmtiles

Single-file executable tool for working with PMTiles archives
BSD 3-Clause "New" or "Revised" License
350 stars 48 forks source link

feat: add NewFileBucket func #145

Closed jzs closed 6 months ago

jzs commented 6 months ago

Enables the possibility to initialize FileBuckets from external packages

jzs commented 6 months ago

I was working on my own Bucket implementations and wanted to support both FileBucket and my own custom SftpBucket implementation when initializing a new server so i needed an exposed way of initializing FileBuckets

bdon commented 6 months ago

@msbarry would it be cleaner here to make Path an exported field?

msbarry commented 6 months ago

@msbarry would it be cleaner here to make Path an exported field?

Only if you want it to be readable. Otherwise it's kind of nice to have a function that all creation goes through in case you want to insert some logic, path normalization, etc.

bdon commented 6 months ago

Thanks for the PR!