# HG changeset patch # User Sascha L. Teichmann # Date 1588185209 -7200 # Node ID 08f623c87ec08fbf10ee6900b294f2080ab8030e # Parent f5564dc0adcce8a38d4422bb39f6126bcb90191f# Parent 11587540e341ca8f9a0edaba40d9124a0e93fc0e Merged default into new-fwa branch. diff -r 11587540e341 -r 08f623c87ec0 pkg/controllers/fwa.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/controllers/fwa.go Wed Apr 29 20:33:29 2020 +0200 @@ -0,0 +1,33 @@ +// This is Free Software under GNU Affero General Public License v >= 3.0 +// without warranty, see README.md and license for details. +// +// SPDX-License-Identifier: AGPL-3.0-or-later +// License-Filename: LICENSES/AGPL-3.0.txt +// +// Copyright (C) 2018, 2019, 2020 by via donau +// – Österreichische Wasserstraßen-Gesellschaft mbH +// Software engineering by Intevation GmbH +// +// Author(s): +// * Sascha L. Teichmann + +package controllers + +import ( + "net/http" + + "github.com/gorilla/mux" +) + +func fairwayAvailability(res http.ResponseWriter, req *http.Request) { + + vars := mux.Vars(req) + + switch vars["kind"] { + case "bottleneck": + case "stretch": + case "section": + } + + // TODO: Implement me! +} diff -r 11587540e341 -r 08f623c87ec0 pkg/controllers/routes.go --- a/pkg/controllers/routes.go Wed Apr 29 16:33:25 2020 +0200 +++ b/pkg/controllers/routes.go Wed Apr 29 20:33:29 2020 +0200 @@ -324,6 +324,9 @@ // Handler to serve data to the client. + api.Handle("/data/{kind:stretch|section|bottleneck}/fairway/{name:.+}", any( + mw.DBConn(http.HandlerFunc(fairwayAvailability)))).Methods(http.MethodGet) + api.Handle("/data/stretch/shape/{name:.+}", any( mw.DBConn(http.HandlerFunc(stretchShapeDownload)))).Methods(http.MethodGet)