httputil

package module
v2.0.0-...-071b5fc Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

go-httputil

A http utility library in Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatParam

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

func FloatQuery

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

func IntParam

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

func IntQuery

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

func JSON

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

Types

type ErrorResponse

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