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 Query ¶
func Query(db service.SQLDB) RequestProcessFunc
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 (*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