Documentation ¶
Index ¶
- Constants
- func CacheFeatureCollection(ctx context.Context, m CacheManager, fc *geojson.FeatureCollection) ([]string, error)
- func CacheFeatures(ctx context.Context, m CacheManager, features [][]byte) ([]string, error)
- func CacheManagerSchemes() []string
- func FeatureId(feature *geojson.Feature) (string, error)
- func FeatureIdFromBytes(body []byte) (string, error)
- func RegisterCacheManager(ctx context.Context, scheme string, init_func CacheManagerInitializationFunc) error
- func UniqueFeatures(ctx context.Context, features []*geojson.Feature) ([][]byte, error)
- func UnmarshalFeatureCache(ctx context.Context, fc *FeatureCache) (*geojson.Feature, error)
- type CacheManager
- func NewCacheManager(ctx context.Context, uri string) (CacheManager, error)
- func NewDocstoreCacheManager(ctx context.Context, uri string) (CacheManager, error)
- func NewDocstoreCacheManagerWithOptions(ctx context.Context, opts *DocstoreCacheManagerOptions) CacheManager
- func NewSQLCacheManager(ctx context.Context, uri string) (CacheManager, error)
- type CacheManagerInitializationFunc
- type DocstoreCacheManager
- type DocstoreCacheManagerOptions
- type FeatureCache
- type SQLCacheManager
- type SQLCacheManagerOptions
- type SQLFeaturesTable
Constants ¶
const FEATURES_CACHE_TABLE string = "pmtiles_features"
Variables ¶
This section is empty.
Functions ¶
func CacheFeatureCollection ¶
func CacheFeatureCollection(ctx context.Context, m CacheManager, fc *geojson.FeatureCollection) ([]string, error)
func CacheFeatures ¶
func CacheManagerSchemes ¶
func CacheManagerSchemes() []string
Schemes returns the list of schemes that have been registered.
func FeatureIdFromBytes ¶
func RegisterCacheManager ¶
func RegisterCacheManager(ctx context.Context, scheme string, init_func CacheManagerInitializationFunc) error
RegisterCacheManager registers 'scheme' as a key pointing to 'init_func' in an internal lookup table used to create new `CacheManager` instances by the `NewCacheManager` method.
func UniqueFeatures ¶
func UnmarshalFeatureCache ¶
Types ¶
type CacheManager ¶
type CacheManager interface { CacheFeature(context.Context, []byte) (*FeatureCache, error) GetFeatureCache(context.Context, string) (*FeatureCache, error) Close() error }
func NewCacheManager ¶
func NewCacheManager(ctx context.Context, uri string) (CacheManager, error)
NewCacheManager returns a new `CacheManager` instance configured by 'uri'. The value of 'uri' is parsed as a `url.URL` and its scheme is used as the key for a corresponding `CacheManagerInitializationFunc` function used to instantiate the new `CacheManager`. It is assumed that the scheme (and initialization function) have been registered by the `RegisterCacheManager` method.
func NewDocstoreCacheManager ¶
func NewDocstoreCacheManager(ctx context.Context, uri string) (CacheManager, error)
func NewDocstoreCacheManagerWithOptions ¶
func NewDocstoreCacheManagerWithOptions(ctx context.Context, opts *DocstoreCacheManagerOptions) CacheManager
func NewSQLCacheManager ¶
func NewSQLCacheManager(ctx context.Context, uri string) (CacheManager, error)
type CacheManagerInitializationFunc ¶
type CacheManagerInitializationFunc func(ctx context.Context, uri string) (CacheManager, error)
CacheManagerInitializationFunc is a function defined by individual cache_manager package and used to create an instance of that cache_manager
type DocstoreCacheManager ¶
type DocstoreCacheManager struct {
// contains filtered or unexported fields
}
func (*DocstoreCacheManager) CacheFeature ¶
func (m *DocstoreCacheManager) CacheFeature(ctx context.Context, body []byte) (*FeatureCache, error)
func (*DocstoreCacheManager) Close ¶
func (m *DocstoreCacheManager) Close() error
func (*DocstoreCacheManager) GetFeatureCache ¶
func (m *DocstoreCacheManager) GetFeatureCache(ctx context.Context, id string) (*FeatureCache, error)
type DocstoreCacheManagerOptions ¶
type DocstoreCacheManagerOptions struct { FeatureCollection *docstore.Collection CacheTTL int }
type FeatureCache ¶
type FeatureCache struct { Created int64 `json:"created"` Id string `json:"id"` // this is a string rather than int64 because it might include an alt label Body string `json:"body"` }
func NewFeatureCache ¶
func NewFeatureCache(body []byte) (*FeatureCache, error)
type SQLCacheManager ¶
type SQLCacheManager struct {
// contains filtered or unexported fields
}
func (*SQLCacheManager) CacheFeature ¶
func (m *SQLCacheManager) CacheFeature(ctx context.Context, body []byte) (*FeatureCache, error)
func (*SQLCacheManager) Close ¶
func (m *SQLCacheManager) Close() error
func (*SQLCacheManager) GetFeatureCache ¶
func (m *SQLCacheManager) GetFeatureCache(ctx context.Context, id string) (*FeatureCache, error)
type SQLCacheManagerOptions ¶
type SQLFeaturesTable ¶ added in v0.5.1
type SQLFeaturesTable struct {
database_sql.Table
}
func (*SQLFeaturesTable) IndexRecord ¶ added in v0.5.1
func (*SQLFeaturesTable) InitializeTable ¶ added in v0.5.1
func (*SQLFeaturesTable) Name ¶ added in v0.5.1
func (t *SQLFeaturesTable) Name() string