apitool

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 13 Imported by: 1

README

api-toolkit

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHost

func GetHost(req *http.Request) string

func GetPostValue

func GetPostValue(req *http.Request, defaultEmpty bool, keys []string) (map[string]interface{}, error)

func ParserDataRequest

func ParserDataRequest(req *http.Request, data interface{}) error

Types

type GinAPI

type GinAPI interface {
	errors.ApiErrorHandler
	GetAPIs() []*GinApiHandler
}

type GinApiHandler

type GinApiHandler struct {
	Handler func(c *gin.Context)
	Method  string
	Path    string
	Auth    bool
	Group   []auth.ApiPerm
}

type GinApiServer

type GinApiServer interface {
	AddAPIs(handlers ...GinAPI) GinApiServer
	Middles(mids ...mid.GinMiddle) GinApiServer
	SetServerErrorHandler(errors.GinServerErrorHandler) GinApiServer
	SetAuth(authmid auth.GinAuthMidInter) GinApiServer
	SetTrustedProxies([]string) GinApiServer
	SetPromhttp(c ...prometheus.Collector) GinApiServer
	Static(relativePath, root string) GinApiServer
	Run(port int) error
	// contains filtered or unexported methods
}

func NewGinApiServer

func NewGinApiServer(mode string, service string) GinApiServer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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