handler

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2018 License: GPL-3.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIHandlerFunc

func APIHandlerFunc(rp RequestProcessFunc) http.HandlerFunc

APIHandlerFunc returns an http.HandlerFunc that will serve the user request taking the serializer.Response and errors from the passed RequestProcessFunc

Types

type RequestProcessFunc

type RequestProcessFunc func(*http.Request) (*serializer.Response, error)

RequestProcessFunc is a function that takes an http.Request, and returns a serializer.Response and an error

func Filter

func Filter() RequestProcessFunc

Filter : placeholder method

func Parse

func Parse() RequestProcessFunc

Parse : placeholder method

func Query

Query returns a function that forwards an SQL query to gitbase and returns the rows as JSON

func Tables

func Tables(db service.SQLDB) RequestProcessFunc

Tables returns a function that calls /query with the SQL "SHOW TABLES"

func Version

func Version(version string) RequestProcessFunc

Version returns a function that returns a *serializer.Response with a current version of server

type Static

type Static struct {
	// contains filtered or unexported fields
}

Static contains handlers to serve static using go-bindata

func NewStatic

func NewStatic(dir, serverURL string, selectLimit int) *Static

NewStatic creates new Static

func (*Static) ServeHTTP

func (s *Static) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves any static file from static directory or fallbacks on index.hml

func (*Static) ServeIndexHTML

func (s *Static) ServeIndexHTML(initialState interface{}) http.HandlerFunc

ServeIndexHTML serves index.html file

Jump to

Keyboard shortcuts

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