autojson: github.com/yobert/autojson Index | Files

package autojson

import "github.com/yobert/autojson"

Index

Package Files

autojson.go

func NewHandler Uses

func NewHandler(service interface{}, methodName string) http.HandlerFunc

NewHandler uses reflection to generate an http.HandlerFunc from a service and method name

type ErrorResponse Uses

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

ErrorResponse will be encoded as JSON and returned if your handler has a return value of type error, with the stringified error populated.

Package autojson imports 7 packages (graph). Updated 2018-11-12. Refresh now. Tools for package owners.