Documentation ¶
Index ¶
- func Base64ToWave(ctx context.Context, content string) ([]byte, error)
- func DecodeJSONBody(r *http.Request, v interface{}) error
- func Errorf(ctx context.Context, status int, msg string, format string, a ...interface{}) error
- func RespondError(w http.ResponseWriter, r *http.Request, err error)
- func RespondErrorJSON(w http.ResponseWriter, r *http.Request, err error)
- func RespondErrorMessage(w http.ResponseWriter, r *http.Request, status int, msg string)
- func RespondJSON(w http.ResponseWriter, r *http.Request, status int, body interface{})
- func Wrapf(format string, a ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64ToWave ¶
Base64ToWave converts audio encoded in base64 into wave.
func DecodeJSONBody ¶
DecodeJSONBody decodes request body as JSON.
func RespondError ¶
func RespondError(w http.ResponseWriter, r *http.Request, err error)
RespondError responds an error.
func RespondErrorJSON ¶
func RespondErrorJSON(w http.ResponseWriter, r *http.Request, err error)
RespondErrorJSON responds error as JSON.
func RespondErrorMessage ¶
RespondErrorMessage responds error messages as JSON.
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, r *http.Request, status int, body interface{})
RespondJSON responds body as JSON.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.