Documentation ¶
Overview ¶
package resolver providers common methods and interfaces for retrieving repository data from a variety of storage systems.
Index ¶
- func RegisterResolver(ctx context.Context, scheme string, f ResolverInitializeFunc) error
- func Schemes() []string
- type DocstoreResolver
- type HTTPResolver
- type ReaderResolver
- type Resolver
- func NewDocstoreResolver(ctx context.Context, uri string) (Resolver, error)
- func NewHTTPResolver(ctx context.Context, uri string) (Resolver, error)
- func NewReaderResolver(ctx context.Context, uri string) (Resolver, error)
- func NewResolver(ctx context.Context, uri string) (Resolver, error)
- func NewSQLiteResolver(ctx context.Context, uri string) (Resolver, error)
- type ResolverInitializeFunc
- type SQLiteResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterResolver ¶
func RegisterResolver(ctx context.Context, scheme string, f ResolverInitializeFunc) error
Types ¶
type DocstoreResolver ¶
type DocstoreResolver struct { Resolver // contains filtered or unexported fields }
type DocstoreResolver implements the `Resolver` interface for data stored in a gocloud.dev/docstore compatible collection.
type HTTPResolver ¶
type HTTPResolver struct { Resolver // contains filtered or unexported fields }
type HTTPResolver implements the `Resolver` interface for data stored in a database exposed via an HTTP endpoint.
type ReaderResolver ¶ added in v2.5.0
type ReaderResolver struct { Resolver // contains filtered or unexported fields }
type ReaderResolver implements the `Resolver` interface for data that can be resolved using a whosonfirst/go-reader.Reader instance.
type Resolver ¶
type Resolver interface { // GetRepo returns the repository name matching an ID. GetRepo(context.Context, int64) (string, error) }
type Resolver defines a storage-independent interface for retrieving a repository name given an ID.
func NewDocstoreResolver ¶
NewDocstoreResolver will return a new `Resolver` instance for resolving repository names and IDs stored in a gocloud.dev/docstore Collection.
func NewHTTPResolver ¶
NewHTTPResolver will return a new `Resolver` instance for resolving repository names and IDs stored in a database exposed via an HTTP endpoint..
func NewReaderResolver ¶ added in v2.5.0
NewReaderResolver will return a new `Resolver` instance for resolving repository names that can be resolved using a whosonfirst/go-reader.Reader instance derived from 'uri'. 'uri' takes the form of:
reader://?reader={READER_URI}&strategy={STRATEGY}
Where:
- {READER_URI} is a valid whosonfirst/go-reader.Reader URI
- {STRATEGY} is a string describing the strategy use to expand the 'id' parameter passed to the `GetRepo` method to a URI. Valid options are: ** 'fname' which will expand '101736545' to '101736545.geojson' (default) ** 'uri' which will expand '101736545' to '101/736/545/101736545.geojson'
type ResolverInitializeFunc ¶
type ResolverInitializeFunc defines an initialization function for a storage-specific implementation of the Resolver interface.
type SQLiteResolver ¶
type SQLiteResolver struct { Resolver // contains filtered or unexported fields }
type SQLiteResolver implements the `Resolver` interface for data stored in a SQLite database..