router

package
v0.0.0-...-610f05e Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProvideRouterStrategy

func ProvideRouterStrategy() fx.Option

func RegisterGinRouters

func RegisterGinRouters(p RegisterRouterIn)

Types

type HttpStrategy

type HttpStrategy struct {
}

func (HttpStrategy) Handle

func (h HttpStrategy) Handle(group *gin.RouterGroup, api qn.Api)

func (HttpStrategy) Protocol

func (h HttpStrategy) Protocol() protocol.ProtocolType

type RegisterRouterIn

type RegisterRouterIn struct {
	fx.In
	Engine         *gin.Engine
	Apis           []qn.Api   `group:"nn_api"`
	RouterStrategy []Strategy `group:"nn_router_strategy"`
}

type Strategy

type Strategy interface {
	Protocol() protocol.ProtocolType
	Handle(group *gin.RouterGroup, api qn.Api)
}

func NewHttpStrategy

func NewHttpStrategy() Strategy

func NewWsStrategy

func NewWsStrategy() Strategy

type WsStrategy

type WsStrategy struct {
}

func (WsStrategy) Handle

func (w WsStrategy) Handle(group *gin.RouterGroup, api qn.Api)

func (WsStrategy) Protocol

func (w WsStrategy) Protocol() protocol.ProtocolType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳