Documentation ¶
Index ¶
- func CredentialsVerifier(db *sql.DB) oauth.CredentialsVerifier
- func LogInternalError(w http.ResponseWriter, code string, err error)
- func LogNotFound(w http.ResponseWriter, code string, id any)
- func LogStatus(w http.ResponseWriter, status int, level log.Level, code string)
- func LogStatusMsg(w http.ResponseWriter, status int, level log.Level, code string, msg string, ...)
- type ResponseBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CredentialsVerifier ¶
func CredentialsVerifier(db *sql.DB) oauth.CredentialsVerifier
func LogInternalError ¶
func LogInternalError(w http.ResponseWriter, code string, err error)
Will log an error, and send an HTTP response with status 500 and default text
func LogNotFound ¶
func LogNotFound(w http.ResponseWriter, code string, id any)
Will log a debug message, and send an HTTP response with status 404 and default text
func LogStatus ¶
Will log an error code at the given level, and send an HTTP response with status and default text
func LogStatusMsg ¶
func LogStatusMsg(w http.ResponseWriter, status int, level log.Level, code string, msg string, args ...any)
Will log an error code and message at the given level, and send an HTTP response with the given status and formatted message
Types ¶
type ResponseBuffer ¶
type ResponseBuffer interface { http.ResponseWriter Status() int Body() []byte Flush(w http.ResponseWriter) error }
func NewResponseBuffer ¶
func NewResponseBuffer() ResponseBuffer
Click to show internal directories.
Click to hide internal directories.