tsmapi

package module
v0.0.0-...-ede4aab Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: MIT Imports: 7 Imported by: 0

README

tsmapi

simple heroku app for reading and writing time series & data

motivation

play with heroku and test some heroku elements like heroku-redis

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeseriesInfo

func GetTimeseriesInfo(w http.ResponseWriter, r *http.Request)

func Initialize

func Initialize() router.Routes

func ReadAllTimeseries

func ReadAllTimeseries(w http.ResponseWriter, r *http.Request)

func ReadTimeseries

func ReadTimeseries(w http.ResponseWriter, r *http.Request)

func WriteTimeseries

func WriteTimeseries(w http.ResponseWriter, r *http.Request)

Types

type ByTime

type ByTime Points

func (ByTime) Len

func (ps ByTime) Len() int

func (ByTime) Less

func (ps ByTime) Less(i, j int) bool

func (ByTime) Swap

func (ps ByTime) Swap(i, j int)

type Point

type Point struct {
	Time   time.Time   `json:"time"`
	Value  float64     `json:"value"`
	Status ValueStatus `json:"state"`
}

type Points

type Points []Point

type Timeseries

type Timeseries struct {
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	Values      Points    `json:"values"`
	LastChanged time.Time `json:"lastChanged"`
}

Timeseries represents a time series with a unique integer Id a name a list of Points and the time of the last write on this series.

type TimeseriesStore

type TimeseriesStore interface {
	Read(id int, start, end time.Time) (Timeseries, error)
	Write(id int, values Points) error
}

type ValueStatus

type ValueStatus int

ValueStatus represents the status of a given point which could be valid or not valid

const (
	VALID ValueStatus = iota
	NOT_VALID
)

Directories

Path Synopsis
Godeps
_workspace/src/github.com/garyburd/redigo/internal/redistest
Package redistest contains utilities for writing Redigo tests.
Package redistest contains utilities for writing Redigo tests.
_workspace/src/github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
cmd

Jump to

Keyboard shortcuts

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