internal

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2024 Michael Davis

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	MaxZoom = 21
)

Variables

This section is empty.

Functions

func GetVersionInformation added in v0.1.0

func GetVersionInformation() (string, string, string)

Returns a tuple containing build version information. Returns: Version in the format vX.Y.Z - will include placeholders for unofficial builds Verson Control System identifier (git ref) Timestamp of when it was built

func ParseZoomString added in v0.2.0

func ParseZoomString(str string) ([]int, error)

func ReplaceEnv added in v0.3.0

func ReplaceEnv(rawConfig map[string]interface{}) map[string]interface{}

Find any string values that start with `env.` and interpret the rest as an environment variable. Replaces the full value with the contents of the respective environment variable. Useful for avoiding secrets in config so your configuration can be placed in source control

Types

type Bounds

type Bounds struct {
	South float64
	North float64
	West  float64
	East  float64
}

func (Bounds) FindTiles

func (b Bounds) FindTiles(layerName string, zoom uint, force bool) (*[]TileRequest, error)

func (Bounds) Intersects added in v0.2.0

func (b Bounds) Intersects(b2 Bounds) bool

type Image

type Image = []byte

type RangeError

type RangeError struct {
	ParamName string
	MinValue  float64
	MaxValue  float64
}

func (RangeError) Error

func (e RangeError) Error() string

type RequestContext added in v0.2.0

type RequestContext struct {
	context.Context

	LimitLayers    bool
	AllowedLayers  []string
	UserIdentifier string
	// contains filtered or unexported fields
}

Custom context type. Links back to request so we can pull attrs into the structured log

func BackgroundContext added in v0.2.0

func BackgroundContext() *RequestContext

func NewRequestContext added in v0.2.0

func NewRequestContext(req *http.Request) RequestContext

func (*RequestContext) Value added in v0.2.0

func (c *RequestContext) Value(keyAny any) any

type TileRequest

type TileRequest struct {
	LayerName string
	Z         int
	X         int
	Y         int
}

func (TileRequest) GetBounds

func (t TileRequest) GetBounds() (*Bounds, error)

func (TileRequest) IntersectsBounds added in v0.2.0

func (t TileRequest) IntersectsBounds(b Bounds) (bool, error)

func (TileRequest) String

func (t TileRequest) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL