Documentation
¶
Overview ¶
Package icchttp contains helper function to handle http requests.
The handers are defined by its own package (icc, applause...).
Index ¶
- Constants
- func AuthMiddleware(next http.Handler, auth Authenticater) http.Handler
- func Error(w http.ResponseWriter, err error)
- func ErrorNoStatus(w io.Writer, err error)
- func HandleHealth(mux *http.ServeMux)
- func HealthClient(ctx context.Context, useHTTPS bool, host, port string, insecure bool) error
- type Authenticater
Constants ¶
View Source
const (
// Path is the basic path for all handlers of this service.
Path = "/system/icc"
)
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(next http.Handler, auth Authenticater) http.Handler
AuthMiddleware checks the user id of the request.
func Error ¶
func Error(w http.ResponseWriter, err error)
Error sends an error message to the client as json-message.
If the error does not have a Type() string message, it is handled as 500er. In other case, it is handled as 400er.
func ErrorNoStatus ¶
ErrorNoStatus is like Error(), but does not write a status message.
func HandleHealth ¶
HandleHealth returns 200 (if the service is running).
Types ¶
Click to show internal directories.
Click to hide internal directories.