Documentation ¶
Overview ¶
Package rest implements the REST server for GlusterD
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendHTTPError ¶
func SendHTTPError(rw http.ResponseWriter, statusCode int, errMsg string)
SendHTTPError is to report error back to the client
func SendHTTPResponse ¶
func SendHTTPResponse(w http.ResponseWriter, statusCode int, rsp interface{})
SendHTTPResponse to send response back to the client
Types ¶
type APIError ¶
type APIError struct {
Error string
}
APIError is the placeholder for error string to report back to the client
type GDRest ¶
GDRest is the GlusterD Rest server
func New ¶
func New() *GDRest
New returns a GDRest object which can listen on the configured address
type Route ¶
type Route struct { Name string Method string Pattern string Version int HandlerFunc http.HandlerFunc }
Route models a route to be set on the GlusterD Rest server This route style comes from the tutorial on http://thenewstack.io/make-a-restful-json-api-go/
Click to show internal directories.
Click to hide internal directories.