Documentation
¶
Index ¶
- func ConfigMatchesName(rawConfig config.LayerConfig, errorMessages config.ErrorMessages, ...) bool
- func ConstructProvider(rawConfig map[string]interface{}, deps layer.ProviderDeps) (layer.Provider, error)
- type CacheControlFacts
- type Layer
- func (l *Layer) BuildTileJSON(name string, tilesURLs []string, allowedArea *pkg.Bounds) TileJSONDocument
- func (l *Layer) CheckZoomBounds(tileRequest pkg.TileRequest) error
- func (l *Layer) IsPattern() bool
- func (l *Layer) MatchesName(ctx context.Context, layerName string) bool
- func (l *Layer) Metadata() ResolvedMetadata
- func (l *Layer) RenderTileNoCache(ctx context.Context, tileRequest pkg.TileRequest) (*pkg.Image, error)
- func (l *Layer) TileJSONEligible() bool
- func (l *Layer) TileJSONNames() []string
- type LayerGroup
- func (lg *LayerGroup) CheckAccess(ctx context.Context, tileRequest pkg.TileRequest) (*Layer, error)
- func (lg *LayerGroup) Close(ctx context.Context) error
- func (lg *LayerGroup) FindLayer(ctx context.Context, layerName string) *Layer
- func (lg *LayerGroup) HasLayer(ctx context.Context, layerName string) bool
- func (lg *LayerGroup) Layers() []*Layer
- func (lg *LayerGroup) ListLayerIDs() []string
- func (lg *LayerGroup) PurgeTile(ctx context.Context, tileRequest pkg.TileRequest) (bool, error)
- func (lg *LayerGroup) RenderTile(ctx context.Context, tileRequest pkg.TileRequest) (*pkg.Image, error)
- func (lg *LayerGroup) RenderTileNoCache(ctx context.Context, tileRequest pkg.TileRequest) (*pkg.Image, error)
- func (lg *LayerGroup) WaitForCacheWrites(ctx context.Context) error
- type Limits
- type ProviderWrapper
- func (t ProviderWrapper) Close(ctx context.Context) error
- func (t ProviderWrapper) GenerateTile(ctx context.Context, providerContext layer.ProviderContext, ...) (*pkg.Image, error)
- func (t ProviderWrapper) Metadata() layer.Description
- func (t ProviderWrapper) PreAuth(ctx context.Context, providerContext layer.ProviderContext) (layer.ProviderContext, error)
- type ResolvedMetadata
- type TileJSONDocument
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigMatchesName ¶ added in v0.13.0
func ConfigMatchesName(rawConfig config.LayerConfig, errorMessages config.ErrorMessages, layerName string) bool
For callers working from raw config before layers are built. An unparseable pattern matches nothing; construction reports it
func ConstructProvider ¶ added in v0.4.0
Types ¶
type CacheControlFacts ¶ added in v0.13.0
type CacheControlFacts struct {
// The layer keeps no tiles itself, which argues against downstream caches keeping them
Uncacheable bool
// Tiles appear to vary by requester, so a shared cache must not hand one caller's tile to the next
PerIdentity bool
// Zero means the layer's cache enforces no TTL
TTL time.Duration
}
What a layer's config says about downstream caching, resolved at construction. The server turns these into headers
type Layer ¶
type Layer struct {
ID string
Pattern []layerSegment
ParamValidator map[string]*regexp.Regexp
ParamMap map[string]paramMapping // Keyed by placeholder name
Config config.LayerConfig
Provider layer.Provider
Cache cache.Cache
ErrorMessages config.ErrorMessages
DataType config.DataType // The version from the config with auto-resolution applied
CacheControl CacheControlFacts // What this layer's cache and provider say about caching its tiles downstream
// contains filtered or unexported fields
}
func ConstructLayer ¶
func ConstructLayer(ctx context.Context, rawConfig config.LayerConfig, defaultClientConfig config.ClientConfig, layerCache cache.Cache, errorMessages config.ErrorMessages, layerGroup *LayerGroup, secreter secret.Secreter, datastoreRegistry *datastores.Registry, clientTransport func(config.ClientConfig) (http.RoundTripper, error)) (*Layer, error)
func (*Layer) BuildTileJSON ¶ added in v0.13.0
func (*Layer) CheckZoomBounds ¶ added in v0.13.0
func (l *Layer) CheckZoomBounds(tileRequest pkg.TileRequest) error
Called before the cache lookup so a cached tile can't bypass a zoom limit added later
func (*Layer) IsPattern ¶ added in v0.13.0
True when a pattern distinct from the ID means there's no single tile URL, so TileJSON needs Config.Examples
func (*Layer) MatchesName ¶ added in v0.13.0
func (*Layer) Metadata ¶ added in v0.13.0
func (l *Layer) Metadata() ResolvedMetadata
func (*Layer) RenderTileNoCache ¶
func (*Layer) TileJSONEligible ¶ added in v0.13.0
func (*Layer) TileJSONNames ¶ added in v0.13.0
type LayerGroup ¶ added in v0.4.0
type LayerGroup struct {
// contains filtered or unexported fields
}
func ConstructLayerGroup ¶ added in v0.4.0
func ConstructLayerGroup(ctx context.Context, cfg config.Config, cacheRegistry *caches.CacheRegistry, secreter secret.Secreter, datastoreRegistry *datastores.Registry, clientTransport func(config.ClientConfig) (http.RoundTripper, error)) (*LayerGroup, error)
func (*LayerGroup) CheckAccess ¶ added in v0.14.0
func (lg *LayerGroup) CheckAccess(ctx context.Context, tileRequest pkg.TileRequest) (*Layer, error)
The checks RenderTile makes before consulting the cache, for callers that act between the two
func (*LayerGroup) Close ¶ added in v0.13.0
func (lg *LayerGroup) Close(ctx context.Context) error
Most notably custom providers
func (*LayerGroup) FindLayer ¶ added in v0.4.0
func (lg *LayerGroup) FindLayer(ctx context.Context, layerName string) *Layer
func (*LayerGroup) HasLayer ¶ added in v0.13.0
func (lg *LayerGroup) HasLayer(ctx context.Context, layerName string) bool
func (*LayerGroup) Layers ¶ added in v0.13.0
func (lg *LayerGroup) Layers() []*Layer
func (*LayerGroup) ListLayerIDs ¶ added in v0.13.0
func (lg *LayerGroup) ListLayerIDs() []string
func (*LayerGroup) PurgeTile ¶ added in v0.13.0
func (lg *LayerGroup) PurgeTile(ctx context.Context, tileRequest pkg.TileRequest) (bool, error)
Resolves the layer and cacheversion like RenderTile so it removes the entry a render would read
func (*LayerGroup) RenderTile ¶ added in v0.4.0
func (lg *LayerGroup) RenderTile(ctx context.Context, tileRequest pkg.TileRequest) (*pkg.Image, error)
func (*LayerGroup) RenderTileNoCache ¶ added in v0.4.0
func (lg *LayerGroup) RenderTileNoCache(ctx context.Context, tileRequest pkg.TileRequest) (*pkg.Image, error)
func (*LayerGroup) WaitForCacheWrites ¶ added in v0.13.0
func (lg *LayerGroup) WaitForCacheWrites(ctx context.Context) error
type Limits ¶ added in v0.13.0
type Limits struct {
MinZoom *int
MaxZoom *int
Bounds config.BoundsConfig
}
The operator's restrictions on a layer, and the only metadata enforced on requests
type ProviderWrapper ¶ added in v0.13.0
type ProviderWrapper struct {
Name string
Provider layer.Provider
// contains filtered or unexported fields
}
Adds tracing spans around every provider. Always used since OTEL no-ops when telemetry is disabled
func (ProviderWrapper) Close ¶ added in v0.13.0
func (t ProviderWrapper) Close(ctx context.Context) error
Closes the whole tree beneath, so the wrapper is deliberately not a Parent
func (ProviderWrapper) GenerateTile ¶ added in v0.13.0
func (t ProviderWrapper) GenerateTile(ctx context.Context, providerContext layer.ProviderContext, tileRequest pkg.TileRequest) (*pkg.Image, error)
func (ProviderWrapper) Metadata ¶ added in v0.13.0
func (t ProviderWrapper) Metadata() layer.Description
func (ProviderWrapper) PreAuth ¶ added in v0.13.0
func (t ProviderWrapper) PreAuth(ctx context.Context, providerContext layer.ProviderContext) (layer.ProviderContext, error)
type ResolvedMetadata ¶ added in v0.13.0
type ResolvedMetadata struct {
Limits Limits
Advertised layer.Description // Always within Limits
}
Computed once at construction
func (ResolvedMetadata) ForRequest ¶ added in v0.13.0
func (r ResolvedMetadata) ForRequest(allowedArea *pkg.Bounds) layer.Description
Narrows the advertised metadata to the area a restricted caller may access
type TileJSONDocument ¶ added in v0.13.0
type TileJSONDocument struct {
TileJSON string `json:"tilejson"` // Version
Name string `json:"name"`
Tiles []string `json:"tiles"`
MinZoom int `json:"minzoom"`
MaxZoom int `json:"maxzoom"`
Bounds []float64 `json:"bounds"`
// Not in the TileJSON spec. MapLibre GL JS reads it to know a source serves MapLibre Tiles
Encoding string `json:"encoding,omitempty"`
config.TileJSONMetadata
}
Per the TileJSON 3.0.0 spec: https://github.com/mapbox/tilejson-spec/tree/master/3.0.0