Documentation
¶
Overview ¶
Package httpd provides all the endpoints
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //ErrMalformedJSON reports a JSON message that cannot be mapped to a struct ErrMalformedJSON = errors.New("Malformed json message") //ErrNotActivatedAccount refines a schema.ErrCredential when the user never logged before. ErrNotActivatedAccount = errors.New("You did not activate the account. Check for the invitation mail in this email mailbox") )
Functions ¶
Types ¶
type EndPoints ¶
type EndPoints struct {
// contains filtered or unexported fields
}
EndPoints is a wrapper to embeds a set of Rest endpoints
func NewEndPoints ¶
func NewEndPoints(not *notifier.Notifier, store *sqlstore.Store, convs feeder.Conventions, cfg config.Rest, org config.Internships) EndPoints
NewEndPoints creates new prefixed endpoints
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
Exchange is a simple utility struct to gather the element manipulated while communicating with a client within a session
type HTTPd ¶
type HTTPd struct {
// contains filtered or unexported fields
}
HTTPd just wrap a HTTP daemon that will serve both the static assets and the rest endpoints
type MonResponseWriter ¶
type MonResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
MonResponseWriter embeds a responsewriter to save the status code then to provide a proper monitoring
func NewMonResponseWriter ¶
func NewMonResponseWriter(res http.ResponseWriter) *MonResponseWriter
NewMonResponseWriter makes a new monitoring response writer
func (*MonResponseWriter) Header ¶
func (w *MonResponseWriter) Header() http.Header
Header delegates to the underlyning writer
func (*MonResponseWriter) Status ¶
func (w *MonResponseWriter) Status() int
Status returns the status code provided by WriteHeader
func (*MonResponseWriter) Write ¶
func (w *MonResponseWriter) Write(data []byte) (int, error)
Writer delegates to the underlyning writer
func (*MonResponseWriter) WriteHeader ¶
func (w *MonResponseWriter) WriteHeader(statusCode int)
WriteHeader saves the status code and delegates to the underlyning writer