server

package
v1.23.39 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixAPIV3 = "/v3/"

	PrefixAPIDefault = "/v4/"
)

Variables

This section is empty.

Functions

func P

func P(mf MethodFunc, action string, hdrs ...interface{})

P .

func ReDocHandler added in v1.23.37

func ReDocHandler(appName, swaggerURL string) gin.HandlerFunc

ReDocHandler 生成 ReDoc 文档页面的 ReDocHandler appName: 应用名称,如 "demoapp" swaggerURL: Swagger JSON 的 URL,如 "/v1/demoapp.docs/doc.json"

Types

type MethodFunc

type MethodFunc func(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

type Router

type Router struct {
	Prefix string
	// contains filtered or unexported fields
}

Router .

func NewRouter

func NewRouter(apiPrefix string, opts ...RouterOption) *Router

NewRouter .

func (*Router) Any added in v0.1.21

func (svr *Router) Any(action string, hdrs ...interface{})

Any .

func (Router) AuthInject

func (ai Router) AuthInject(issuer string, injector auth.InjectorFunc)

func (Router) Default

func (ai Router) Default(injector auth.InjectorFunc)

func (*Router) G

func (svr *Router) G(action string, hdrs ...interface{})

G .

func (*Router) GRequireLogin added in v1.3.30

func (svr *Router) GRequireLogin(action string, hdrs ...interface{})

GRequireLogin .

func (*Router) GinEngine

func (svr *Router) GinEngine() *gin.Engine

GinEngine .

func (*Router) HandleDoc

func (svr *Router) HandleDoc(model string)

func (Router) Inject

func (ai Router) Inject(ctx *gin.Context)

func (*Router) ListAllRouters

func (svr *Router) ListAllRouters()

ListAllRouters 列出所有路由

func (*Router) P

func (svr *Router) P(action string, hdrs ...interface{})

P .

func (*Router) PRequireEmployee

func (svr *Router) PRequireEmployee(action string, hdrs ...interface{})

PRequireEmployee .

func (*Router) PRequireLogin added in v0.1.9

func (svr *Router) PRequireLogin(action string, hdrs ...interface{})

PRequireLogin .

func (*Router) Run

func (svr *Router) Run(l net.Listener) error

Run .

type RouterOption added in v1.3.56

type RouterOption func(*Router)

func WithDeployMode added in v1.3.56

func WithDeployMode(deployMode string) RouterOption

func WithMiddleware added in v1.23.7

func WithMiddleware(middleware ...gin.HandlerFunc) RouterOption

func WithPrefixes added in v1.3.56

func WithPrefixes(prefixes []string) RouterOption

Jump to

Keyboard shortcuts

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