util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_LIMIT = 100
View Source
const DEFAULT_OFFSET = 0

Variables

This section is empty.

Functions

func NewCors

func NewCors(handler http.Handler) http.Handler

func NewLogger

func NewLogger(handler http.Handler) http.Handler

func ParseLimit

func ParseLimit(str string) (limit int, err error)

func ParseOffset

func ParseOffset(str string) (limit int, err error)

func ParseSort

func ParseSort(str string, fields []string) (field string, asc bool, err error)

Types

type CorsMiddleware

type CorsMiddleware struct {
	// contains filtered or unexported fields
}

func (*CorsMiddleware) ServeHTTP

func (this *CorsMiddleware) ServeHTTP(res http.ResponseWriter, req *http.Request)

type LoggerMiddleWare

type LoggerMiddleWare struct {
	// contains filtered or unexported fields
}

func (*LoggerMiddleWare) ServeHTTP

func (this *LoggerMiddleWare) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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