Documentation ¶
Overview ¶
Package routes defines HTTP routes for the Freyr api.
Index ¶
- Variables
- func DeleteReadings(s models.ReadingStore) apollo.Handler
- func GenerateSecret(s models.SecretStore) apollo.Handler
- func GetLatestReadings(s models.ReadingStore) apollo.Handler
- func GetReadings(s models.ReadingStore) apollo.Handler
- func Jobs(j bifrost.JobDispatcher) apollo.Handler
- func PostReading(s models.ReadingStore) apollo.Handler
- func PostReadings(j bifrost.JobDispatcher, s models.ReadingStore) apollo.Handler
- func Readings(j bifrost.JobDispatcher, s models.ReadingStore) apollo.Handler
- func RotateSecret(s models.SecretStore) apollo.Handler
- func StringsEmpty(strs ...string) bool
- func User(s models.UserStore) apollo.Handler
Constants ¶
This section is empty.
Variables ¶
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 ¶
func PostReadings(j bifrost.JobDispatcher, s models.ReadingStore) apollo.Handler
PostReadings returns a handler that accepts HTTP requests to store multiple readings
func Readings ¶
func Readings(j bifrost.JobDispatcher, s models.ReadingStore) apollo.Handler
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 ¶
StringsEmpty returns true if any passed string arguments are zero valued ("")
Types ¶
This section is empty.