util

package
v0.0.0-...-3a7c62b Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: CC-BY-SA-4.0, GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION = "1.4.4"
)

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, logger *Logger, err error, status int)

func GetIntParam

func GetIntParam(param string, r *http.Request) (int, error)

func GetParam

func GetParam(param string, r *http.Request) (string, error)

func ResponseBadRequest

func ResponseBadRequest(w http.ResponseWriter, logger *Logger, err error)

func ResponseInternalError

func ResponseInternalError(w http.ResponseWriter, logger *Logger, err error)

func ResponseUnauthorized

func ResponseUnauthorized(w http.ResponseWriter, logger *Logger, err error)

Types

type Logger

type Logger struct {
	LogTraceId int
}

func NewLogger

func NewLogger() *Logger

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Err

func (l *Logger) Err(format string, args ...interface{})

func (*Logger) Log

func (l *Logger) Log(format string, args ...interface{})

func (*Logger) LogQuery

func (l *Logger) LogQuery(query string, args ...interface{})

func (*Logger) Stack

func (l *Logger) Stack(err error)

Jump to

Keyboard shortcuts

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