httputils

package
v0.0.0-...-bee09c4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractLimitParam

func ExtractLimitParam(c *gin.Context) (int, error)

ExtractLimitParam ...

func ExtractPaginationParams

func ExtractPaginationParams(c *gin.Context) (offset, limit int, err error)

ExtractPaginationParams ...

func GetEnv

func GetEnv() string

GetEnv ...

func Logger

func Logger() gin.HandlerFunc

Logger receives gin contexts and return formated string with header and body

func ParseSortBy

func ParseSortBy(sortBy string) (sortKey, sortDirection string)

ParseSortBy ...

Types

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Details string `json:"details"`
}

Error ...

func ErrorResponse

func ErrorResponse(err error) *Error

ErrorResponse ...

type PaginationResponse

type PaginationResponse struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
	Total  int `json:"total"`
}

PaginationResponse ...

Jump to

Keyboard shortcuts

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