Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeHeader = "Content-Type" ContentTypeJSON = "application/json" )
ContentType header possible values
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JSONEncoder ¶
type JSONEncoder interface {
WriteResponseJSON(w http.ResponseWriter, value interface{}, status int) error
}
JSONEncoder interface defining a JSON encoder.
var JsonResponseEncoder JSONEncoder = &OnsJSONEncoder{}
type OnsJSONEncoder ¶
type OnsJSONEncoder struct{}
OnsJSONEncoder is a JSON encoder
func (*OnsJSONEncoder) WriteResponseJSON ¶
func (j *OnsJSONEncoder) WriteResponseJSON(w http.ResponseWriter, value interface{}, status int) error
WriteResponseJSON marshals the provided value as json body, and sets the status code to the provided value
Click to show internal directories.
Click to hide internal directories.