http

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2014 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CayleyHTTP

func CayleyHTTP(ts graph.TripleStore, cfg *config.CayleyConfig)

func FormatJson400

func FormatJson400(w http.ResponseWriter, err interface{}) int

func FormatJsonError

func FormatJsonError(w http.ResponseWriter, code int, err interface{}) int

func GetQueryShape

func GetQueryShape(query string, ses graph.HttpSession) ([]byte, error)

func LogRequest

func LogRequest(handler ResponseHandler) httprouter.Handle

func MarkdownWithCSS

func MarkdownWithCSS(input []byte, title string) []byte

func ParseJsonToTripleList

func ParseJsonToTripleList(jsonBody []byte) ([]*graph.Triple, error)

func RunJsonQuery

func RunJsonQuery(query string, ses graph.HttpSession) (interface{}, error)

func SetupRoutes

func SetupRoutes(ts graph.TripleStore, cfg *config.CayleyConfig)

func WrapErrResult

func WrapErrResult(err error) ([]byte, error)

func WrapResult

func WrapResult(result interface{}) ([]byte, error)

Types

type Api

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

func (*Api) ApiV1

func (api *Api) ApiV1(r *httprouter.Router)

func (*Api) ServeV1Delete

func (api *Api) ServeV1Delete(w http.ResponseWriter, r *http.Request, params httprouter.Params) int

func (*Api) ServeV1Query

func (api *Api) ServeV1Query(w http.ResponseWriter, r *http.Request, params httprouter.Params) int

TODO(barakmich): Turn this into proper middleware.

func (*Api) ServeV1Shape

func (api *Api) ServeV1Shape(w http.ResponseWriter, r *http.Request, params httprouter.Params) int

func (*Api) ServeV1Write

func (api *Api) ServeV1Write(w http.ResponseWriter, r *http.Request, _ httprouter.Params) int

func (*Api) ServeV1WriteNQuad

func (api *Api) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params httprouter.Params) int

type DocRequestHandler

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

func (*DocRequestHandler) ServeHTTP

func (h *DocRequestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, params httprouter.Params)

type ErrorQueryWrapper

type ErrorQueryWrapper struct {
	Error string `json:"error"`
}

type ResponseHandler

type ResponseHandler func(http.ResponseWriter, *http.Request, httprouter.Params) int

type SuccessQueryWrapper

type SuccessQueryWrapper struct {
	Result interface{} `json:"result"`
}

type TemplateRequestHandler

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

func (*TemplateRequestHandler) ServeHTTP

Jump to

Keyboard shortcuts

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