Documentation ¶
Overview ¶
You can use the "packr clean" command to clean up this, and any other packr generated files.
Index ¶
- func CORS(h http.Handler) http.Handler
- func HandleHealth(w http.ResponseWriter, r *http.Request)
- func HandlePreflight(w http.ResponseWriter, r *http.Request)
- func LogRequest(handler http.Handler) http.Handler
- func ParseJSONToQuadList(jsonBody []byte) (out []quad.Quad, _ error)
- func SetupRoutes(handle *graph.Handle, cfg *Config) error
- func WriteError(w io.Writer, err error) error
- func WriteResult(w io.Writer, result interface{}) error
- type API
- func (api *API) APIv1(r *httprouter.Router)
- func (api *API) GetHandleForRequest(r *http.Request) (*graph.Handle, error)
- func (api *API) RWOnly(handler httprouter.Handle) httprouter.Handle
- func (api *API) ServeV1Delete(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (api *API) ServeV1Query(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (api *API) ServeV1Shape(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (api *API) ServeV1Write(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- type Config
- type ErrorQueryWrapper
- type SuccessQueryWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleHealth ¶
func HandleHealth(w http.ResponseWriter, r *http.Request)
HandleHealth is a route for handling health checks to the server
func HandlePreflight ¶
func HandlePreflight(w http.ResponseWriter, r *http.Request)
HandlePreflight is an http.Handler for CORS Prelight requests
func LogRequest ¶
LogRequest wraps a http.Handler and emits logs about the request and the response
func WriteResult ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) APIv1 ¶
func (api *API) APIv1(r *httprouter.Router)
func (*API) GetHandleForRequest ¶
func (*API) RWOnly ¶
func (api *API) RWOnly(handler httprouter.Handle) httprouter.Handle
func (*API) ServeV1Delete ¶
func (api *API) ServeV1Delete(w http.ResponseWriter, r *http.Request, params httprouter.Params)
func (*API) ServeV1Query ¶
func (api *API) ServeV1Query(w http.ResponseWriter, r *http.Request, params httprouter.Params)
ServeV1Query is the HTTP handler for queries in API V1
func (*API) ServeV1Shape ¶
func (api *API) ServeV1Shape(w http.ResponseWriter, r *http.Request, params httprouter.Params)
func (*API) ServeV1Write ¶
func (api *API) ServeV1Write(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func (*API) ServeV1WriteNQuad ¶
func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params httprouter.Params)
type ErrorQueryWrapper ¶
type ErrorQueryWrapper struct {
Error string `json:"error"`
}
type SuccessQueryWrapper ¶
type SuccessQueryWrapper struct {
Result interface{} `json:"result"`
}
Click to show internal directories.
Click to hide internal directories.