routes

package
v0.0.0-...-721f978 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package routes defines HTTP routes for the Freyr api.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrorNoReading is used when a reading is not present in a
	// Post request.
	ErrorNoReading = errors.New("reading not present in request")
)

Functions

func DeleteReadings

func DeleteReadings(s models.ReadingStore) apollo.Handler

DeleteReadings handles HTTP requests to delete readings for a user between the specified dates.

func GenerateSecret

func GenerateSecret(s models.SecretStore) apollo.Handler

GenerateSecret handles an HTTP requests to generate the first secret for a particular user. This endpoint should be called once, and then RotateSecret thereafter with an API signed request.

func GetLatestReadings

func GetLatestReadings(s models.ReadingStore) apollo.Handler

GetLatestReadings handles HTTP requests for the latest reading per core owned by a particular user.

func GetReadings

func GetReadings(s models.ReadingStore) apollo.Handler

GetReadings handles HTTP requests for readings made by a particular core between a start and end date.

func PostReading

func PostReading(s models.ReadingStore) apollo.Handler

PostReading returns a handler that accepts HTTP requests to store new readings.

func PostReadings

PostReadings returns a handler that accepts HTTP requests to store multiple readings

func Readings

Readings is the generalized route for the /readings path

func RotateSecret

func RotateSecret(s models.SecretStore) apollo.Handler

RotateSecret replaces a user's currently stored secret and replaces it with a new, randomly generated, one.

func StringsEmpty

func StringsEmpty(strs ...string) bool

StringsEmpty returns true if any passed string arguments are zero valued ("")

func User

User handles HTTP requests for a user's info.

Types

This section is empty.

Jump to

Keyboard shortcuts

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