Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentType = "Content-Type" ApplicationJSON = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func EncodeResponse ¶
func EncodeResponse(w http.ResponseWriter, response interface{}) error
EncodeResponse encodes a generic response
Types ¶
type Error ¶
Error is a wrapper struct that provides HTTP Status code to an error
func (Error) MarshalJSON ¶
MarshalJSON satisfies json.Marshaler
type MessageServer ¶
type MessageServer struct {
Message string
}
func (MessageServer) ServeHTTP ¶
func (m MessageServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.