httputil

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

README

go-httputil

A http utility library in Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatParam added in v0.3.6

func FloatParam(c *gin.Context, key string) (i float64, err error)

func FloatQuery added in v0.3.6

func FloatQuery(c *gin.Context, key string) (i float64, err error)

func IntParam added in v0.3.5

func IntParam(c *gin.Context, key string) (i int64, err error)

func IntQuery added in v0.3.6

func IntQuery(c *gin.Context, key string) (i int64, err error)

func JSON added in v0.3.5

func JSON(c *gin.Context, status int, value interface{}, err error)

Types

type ErrorResponse added in v0.3.5

type ErrorResponse struct {
	Error string `json:"error"`
}

type LogWriter

type LogWriter struct {
	Logger    *logrus.Logger
	Level     logrus.Level
	Component string
}

LogWriter implements io.Writer and writes all incoming text out to the specified log level.

func (LogWriter) Write

func (d LogWriter) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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