Documentation
¶
Index ¶
- func RegisterProvider(reg ProviderRegistration)
- func RegisteredProviderNames() []string
- type Layer
- type LayerGroup
- func (lg LayerGroup) FindLayer(ctx context.Context, layerName string) *Layer
- func (lg LayerGroup) ListLayerIDs() []string
- 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)
- type Provider
- type ProviderContext
- type ProviderRegistration
- type ProviderWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func RegisterProvider(reg ProviderRegistration)
func RegisteredProviderNames ¶
func RegisteredProviderNames() []string
Types ¶
type Layer ¶
type Layer struct {
ID string
Pattern []layerSegment
ParamValidator map[string]*regexp.Regexp
Config config.LayerConfig
Provider Provider
Cache cache.Cache
ErrorMessages config.ErrorMessages
// contains filtered or unexported fields
}
func ConstructLayer ¶
func ConstructLayer(rawConfig config.LayerConfig, defaultClientConfig config.ClientConfig, errorMessages config.ErrorMessages, layerGroup *LayerGroup, secreter secret.Secreter, datastores *datastore.DatastoreRegistry) (*Layer, error)
func (*Layer) RenderTileNoCache ¶
type LayerGroup ¶
func ConstructLayerGroup ¶
func ConstructLayerGroup(cfg config.Config, cache cache.Cache, secreter secret.Secreter, datastores *datastore.DatastoreRegistry) (*LayerGroup, error)
func (LayerGroup) FindLayer ¶
func (lg LayerGroup) FindLayer(ctx context.Context, layerName string) *Layer
func (LayerGroup) ListLayerIDs ¶
func (lg LayerGroup) ListLayerIDs() []string
func (LayerGroup) RenderTile ¶
func (lg LayerGroup) RenderTile(ctx context.Context, tileRequest pkg.TileRequest) (*pkg.Image, error)
func (*LayerGroup) RenderTileNoCache ¶
func (lg *LayerGroup) RenderTileNoCache(ctx context.Context, tileRequest pkg.TileRequest) (*pkg.Image, error)
type Provider ¶
type Provider interface {
// Performs authentication before tiles are ever generated. The calling code ensures this is only called once at a time and only when needed
// based on the expiration in layergroup.ProviderContext and when an AuthError is returned from GenerateTile
PreAuth(ctx context.Context, providerContext ProviderContext) (ProviderContext, error)
GenerateTile(ctx context.Context, providerContext ProviderContext, tileRequest pkg.TileRequest) (*pkg.Image, error)
}
func ConstructProvider ¶
func ConstructProvider(rawConfig map[string]interface{}, clientConfig config.ClientConfig, errorMessages config.ErrorMessages, layerGroup *LayerGroup, datastores *datastore.DatastoreRegistry) (Provider, error)
type ProviderContext ¶
type ProviderContext struct {
AuthBypass bool // If true, avoids ever calling preauth again
AuthExpiration time.Time // When next to trigger preauth
AuthToken string // The main auth token that comes back from the preauth and is used by the generate method. Details are up to the provider
Other map[string]interface{} // A generic holder in cases where a provider needs extra storage - for instance Blend which needs Context for child providers
}
type ProviderRegistration ¶
type ProviderRegistration interface {
Name() string
Initialize(config any, clientConfig config.ClientConfig, errorMessages config.ErrorMessages, layerGroup *LayerGroup, datastores *datastore.DatastoreRegistry) (Provider, error)
InitializeConfig() any
}
func RegisteredProvider ¶
func RegisteredProvider(name string) (ProviderRegistration, bool)
type ProviderWrapper ¶ added in v0.6.0
A struct that wraps all other providers in order to add in instrumentation, specifically child spans for tracing the flow between providers. This is used even when telemetry is disabled but OTEL handles no-op'ing in that case so performance impact is minimal
func (ProviderWrapper) GenerateTile ¶ added in v0.6.0
func (t ProviderWrapper) GenerateTile(ctx context.Context, providerContext ProviderContext, tileRequest pkg.TileRequest) (*pkg.Image, error)
func (ProviderWrapper) PreAuth ¶ added in v0.6.0
func (t ProviderWrapper) PreAuth(ctx context.Context, providerContext ProviderContext) (ProviderContext, error)
Click to show internal directories.
Click to hide internal directories.