handler

package
v0.0.0-...-bade21a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64ToWave

func Base64ToWave(ctx context.Context, content string) ([]byte, error)

Base64ToWave converts audio encoded in base64 into wave.

func DecodeJSONBody

func DecodeJSONBody(r *http.Request, v interface{}) error

DecodeJSONBody decodes request body as JSON.

func Errorf

func Errorf(ctx context.Context, status int, msg string, format string, a ...interface{}) error

Errorf constructs a new error for handler.

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

func RespondErrorMessage(w http.ResponseWriter, r *http.Request, status int, msg string)

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.

func Wrapf

func Wrapf(format string, a ...interface{}) error

Wrapf wraps an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL