handler

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: GPL-3.0 Imports: 21 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

func Export added in v0.0.3

func Export(db service.SQLDB) http.HandlerFunc

Export returns a function that forwards an SQL query to gitbase and returns the rows as CSV file

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 DetectLanguage added in v0.0.7

func DetectLanguage() RequestProcessFunc

DetectLanguage returns a function that detects language by filename and content

func Filter

func Filter() RequestProcessFunc

Filter returns a function that filters UAST protobuf and returns UAST JSON

func GetLanguages added in v0.0.7

func GetLanguages(bbblfshServerURL string) RequestProcessFunc

GetLanguages returns a list of supported languages by bblfsh

func Parse

func Parse(bbblfshServerURL string) RequestProcessFunc

Parse returns a function that parses text contents using bblfsh and returns UAST

func Query

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

func Schema added in v0.0.3

func Schema(db service.SQLDB) RequestProcessFunc

Schema returns DB schema

func Version

func Version(version, bbblfshServerURL string, db service.SQLDB) RequestProcessFunc

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

type Static

type Static struct{}

Static without the 'bindata' tag contains a placeholder handler that returns 'not implemented'

func NewStatic

func NewStatic(dir, serverURL string, selectLimit int, footerHTML string) *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

Jump to

Keyboard shortcuts

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