Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrUnsupportedURLScheme = errors.New("Unsupported URL scheme")
)
Errors that might be returned outside the package.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface {
// Get returns a zip.Reader pointer based on the latest copy of the data the
// provider refers to. It may be called multiple times, and caching is left
// up to the individual Provider implementation.
Get(ctx context.Context) (*zip.Reader, error)
}
Provider is the interface implemented by everything that can return a zip.Reader.
func FromURL ¶
FromURL returns a new zipfile.Provider based on the passed-in URL. Supported URL schemes are currently: gs://bucket/filename and file:localpath . Whether the path contained in the URL is valid isn't known until the Get() method of the returned Provider is called. Unsupported URL schemes cause this to return ErrUnsupportedURLScheme.
Users interested in having the daemon download the data directly from MaxMind should implement an https case in the below handler. M-Lab doesn't need that case because we cache MaxMind's data to reduce load on their servers and to eliminate a runtime dependency on a third party service.