routes

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package routes contains all the handlers used in the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Logger      *koan.Logger
	Datasources map[string]internal.Datasource
	Mtx         *sync.Mutex
}

func (*App) DatasourceGetAll

func (a *App) DatasourceGetAll(w http.ResponseWriter, r *http.Request)

DatasourceGetAll will retrieve all data for a datasource in JSON format

func (*App) DatasourceGetByID

func (a *App) DatasourceGetByID(w http.ResponseWriter, r *http.Request)

DatasourceGetByID will process a request for a datasource and return the element that matches the ID in JSON format

func (*App) Home

func (a *App) Home(w http.ResponseWriter, _ *http.Request)

Home provides basic instruction on how to poll the datasources hosted by the application as text format.

func (*App) ListDatasources

func (a *App) ListDatasources(w http.ResponseWriter, _ *http.Request)

ListDatasources provides a summary of datasources hosted by the application in JSON format

Jump to

Keyboard shortcuts

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