api

package
v0.0.0-...-2686f8f Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Cache      cache.Cache
	Providers  provider.List
	Downloader downloader.Downloader

	Logger *zap.Logger

	MaxSide int // max side value
}

API represent struct for business logic

func CreateAPI

func CreateAPI(logger *zap.Logger, cacheOpts *options.Cache, providerSource string, maxSide int) (*API, error)

CreateAPI create API struct

func (*API) HealthCheck

func (a *API) HealthCheck(w http.ResponseWriter, _ *http.Request)

HealthCheck godoc @Summary handler for health check @Description just return HealthCheckModel with API status (always return 200) @Accept json @Produce application/json @Success 200 {object} healthCheckModel @Header 200 {string} X-Request-Id "request_id" @Router /healthcheck [get]

func (*API) Map

func (a *API) Map(w http.ResponseWriter, req *http.Request)

Map godoc @Summary handler for generating satellite map for specified lat long and from specified vendor @Description return merged satellite tiles in one image @Accept text/plain @Produce image/jpeg @Param provider query string true "tile provider" @Param lat query number true "latitude" @Param long query number true "longitude" @Param zoom query int true "zoom of image" @Param side query int false "count of tile of result image square" default(3) minimum(1) maximum(10) @Success 200 {file} image/jpeg @Failure 400 {object} mapErrorModel @Header 200 {string} X-Request-Id "request_id" @Router /map [get]

func (*API) Provider

func (a *API) Provider(w http.ResponseWriter, _ *http.Request)

Provider godoc @Summary handler return all registered providers @Description reutrn JSON array with avalible provders @Accept text/plain @Produce application/json @Success 200 {array} providerModel @Header 200 {string} X-Request-Id "request_id" @Router /provider [get]

Jump to

Keyboard shortcuts

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