Documentation ¶
Index ¶
- func GetBearerToken(ctx context.Context, args router.MiddlewareArgs) string
- func SendError(ctx context.Context, w http.ResponseWriter, status int, message string, ...)
- func SendInternalServerError(ctx context.Context, w http.ResponseWriter, err error)
- func SendInvalidParameter(ctx context.Context, w http.ResponseWriter, name string, err error)
- func SendJSON(ctx context.Context, w http.ResponseWriter, status int, data interface{})
- func SendJwtUnsupportedError(ctx context.Context, w http.ResponseWriter)
- func SendMissingParameter(ctx context.Context, w http.ResponseWriter, name string)
- func SendNoContent(ctx context.Context, w http.ResponseWriter)
- func SendPubSubUnsupportedError(ctx context.Context, w http.ResponseWriter)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBearerToken ¶
func GetBearerToken(ctx context.Context, args router.MiddlewareArgs) string
GetBearerToken returns "Authorization: Bearer ..." value. If not found, returns "".
func SendInternalServerError ¶
func SendInternalServerError(ctx context.Context, w http.ResponseWriter, err error)
SendInternalServerError send 500
func SendInvalidParameter ¶
SendInvalidParameter send 400
func SendJSON ¶
func SendJSON(ctx context.Context, w http.ResponseWriter, status int, data interface{})
SendJSON send JSON response body
func SendJwtUnsupportedError ¶
func SendJwtUnsupportedError(ctx context.Context, w http.ResponseWriter)
SendJwtUnsupportedError send 501
func SendMissingParameter ¶
func SendMissingParameter(ctx context.Context, w http.ResponseWriter, name string)
SendMissingParameter send 400
func SendNoContent ¶
func SendNoContent(ctx context.Context, w http.ResponseWriter)
SendNoContent sends 204 No Content
func SendPubSubUnsupportedError ¶
func SendPubSubUnsupportedError(ctx context.Context, w http.ResponseWriter)
SendPubSubUnsupportedError send 501
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.