router

package
v0.0.0-...-8f2760a Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Elastic *elastic.Client

Functions

func GetData

func GetData(w http.ResponseWriter, req *http.Request)

GetData gets V1 data Return entry curl -XGET 'http://HOST:PORT/v1/data/NAME, equivalent to curl -XGET 'http://HOST:PORT/v1/data?name=NAME'

curl -XGET 'http://HOST:PORT/v1/data/NAME,

func GetDataIndex

func GetDataIndex(w http.ResponseWriter, req *http.Request)

GetDataIndex lists all data and or queries them Return all entries curl -XGET 'http://HOST:PORT/v1/data

Can search for specific fields curl -XGET 'http://HOST:PORT/v1/data?key=val&key2=val2'

func GetDataName

func GetDataName(w http.ResponseWriter, req *http.Request)

GetDataName gets V1 data curl -XGET 'http://HOST:PORT/v1/data/NAME, equivalent to curl -XGET 'http://HOST:PORT/v1/data?name=NAME'

func GetIndex

func GetIndex(w http.ResponseWriter, req *http.Request)

GetIndex is the root of V1 API

func NewRouter

func NewRouter() *mux.Router

func Root

func Root(w http.ResponseWriter, req *http.Request)

Root path output

func Tracer

func Tracer(method, url, body string)

Types

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route handles API Routing

type RoutesV1

type RoutesV1 []Route

RoutesV1 is an Array of routes

Jump to

Keyboard shortcuts

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