Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONErrorResponse ¶
func JSONErrorResponse(w http.ResponseWriter, err error)
JSONErrorResponse is a convenience function to transform errors into JSON HTTP responses
func JSONOKResponse ¶
func JSONOKResponse(w http.ResponseWriter, message string)
JSONOKResponse is a convenience function to transform success messages into JSON HTTP responses
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, payload interface{})
JSONResponse is a convenience function to transform data into JSON HTTP responses
Types ¶
type HTTPTransport ¶
type HTTPTransport struct {
// contains filtered or unexported fields
}
HTTPTransport implements an HTTP server around a NetLog.
func NewHTTPTransport ¶
func NewHTTPTransport(nl *netlog.NetLog) *HTTPTransport
NewHTTPTransport transport sets up an HTTP interface around a NetLog.
func (*HTTPTransport) ServeHTTP ¶
func (ht *HTTPTransport) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface around a NetLog.
Click to show internal directories.
Click to hide internal directories.