tools

package
v0.0.0-...-e824e62 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLimitOffsetFromHttpReq

func GetLimitOffsetFromHttpReq(req *http.Request) types.DBLimitOffset

func GetPagination

func GetPagination(totalRows, pageNumber uint64) types.Pagination

func NewError

func NewError(code int, text string) error

func NewErrorf

func NewErrorf(code int, format string, a ...interface{}) error

func ReadAll

func ReadAll(rc io.ReadCloser) ([]byte, error)

func SendJSON

func SendJSON(resp http.ResponseWriter, obj interface{})

Types

type ClosingBuffer

type ClosingBuffer struct {
	*bytes.Buffer
}

func (*ClosingBuffer) Close

func (cb *ClosingBuffer) Close() error

type CodeError

type CodeError struct {
	Code int
	Text string
}

CodeError is a error with a code (like 404 Not Found).

func (CodeError) Error

func (e CodeError) Error() string

Jump to

Keyboard shortcuts

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