api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(pos1, pos2 *owm.Coordinates) float64

Distance calculates the shortest path between two coordinates on the surface of the Earth.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API holds our database, config and webServer

func New

func New(conf *config.Configuration) *API

New creates a new API-Handler

func (*API) Start

func (a *API) Start()

Start our API Server

func (*API) Stop

func (a *API) Stop(ctx context.Context) error

Stop gracefull stop api server

type Response

type Response struct {
	Current *owm.CurrentWeatherData `json:"current"`
}

Response is the actual reponse of our API this is what we have to cache

Jump to

Keyboard shortcuts

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