netlog: Index | Files

package transport

import ""


Package Files


func JSONErrorResponse Uses

func JSONErrorResponse(w http.ResponseWriter, err error)

JSONErrorResponse is a convenience function to transform errors into JSON HTTP responses

func JSONOKResponse Uses

func JSONOKResponse(w http.ResponseWriter, message string)

JSONOKResponse is a convenience function to transform success messages into JSON HTTP responses

func JSONResponse Uses

func JSONResponse(w http.ResponseWriter, payload interface{})

JSONResponse is a convenience function to transform data into JSON HTTP responses

type HTTPTransport Uses

type HTTPTransport struct {
    // contains filtered or unexported fields

HTTPTransport implements an HTTP server around a NetLog.

func NewHTTPTransport Uses

func NewHTTPTransport(nl *netlog.NetLog) *HTTPTransport

NewHTTPTransport transport sets up an HTTP interface around a NetLog.

func (*HTTPTransport) ServeHTTP Uses

func (ht *HTTPTransport) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface around a NetLog.

type IDMsg Uses

type IDMsg struct {
    ID string `json:"id"`

IDMsg is the standard response when returning an ID

Package transport imports 12 packages (graph). Updated 2018-11-14. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).