Documentation ¶
Index ¶
- Variables
- func AsControllerRoute(controller any) any
- func AsHandlerRoute(handler any) any
- func NewGrpc(p GrpcParams) *grpc.Server
- func NewHttp(config *Config, router *gin.Engine) *http.Server
- func NewOgentServer(p OgentServerParams) (*ogent.Server, error)
- type Config
- type ControllerRoute
- type GraphQLHandler
- type GraphQLParams
- type GraphQLPlaygroundHandler
- type GrpcConfig
- type GrpcParams
- type HandlerRoute
- type OgentServerParams
- type Params
- type Result
- type SwaggerHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewHttp), fx.Invoke(runHttpServer), fx.Provide(NewGrpc), fx.Invoke(runGrpcServer), fx.Provide(NewRouter), fx.Provide(AsControllerRoute(NewSwaggerHandler)), fx.Provide(AsHandlerRoute(NewGraphqlHandler), AsHandlerRoute(NewGraphQLPlaygroundHandler)), fx.Provide(NewOgentServer), )
Functions ¶
func AsControllerRoute ¶
func AsHandlerRoute ¶
func NewGrpc ¶
func NewGrpc(p GrpcParams) *grpc.Server
func NewOgentServer ¶
func NewOgentServer(p OgentServerParams) (*ogent.Server, error)
Types ¶
type Config ¶
type Config struct {
ListenAddr string `mapstructure:"listen_addr" yaml:"listen_addr" validate:"required"`
}
type ControllerRoute ¶
type ControllerRoute interface { RegisterControllerRoutes(rg *gin.RouterGroup) RoutePattern() string }
type GraphQLHandler ¶
func NewGraphqlHandler ¶
func NewGraphqlHandler(p GraphQLParams) *GraphQLHandler
func (*GraphQLHandler) HttpHandler ¶
func (h *GraphQLHandler) HttpHandler() http.Handler
func (*GraphQLHandler) RoutePattern ¶
func (h *GraphQLHandler) RoutePattern() string
type GraphQLPlaygroundHandler ¶
type GraphQLPlaygroundHandler struct{}
func NewGraphQLPlaygroundHandler ¶
func NewGraphQLPlaygroundHandler() *GraphQLPlaygroundHandler
func (*GraphQLPlaygroundHandler) HttpHandler ¶
func (h *GraphQLPlaygroundHandler) HttpHandler() http.Handler
func (*GraphQLPlaygroundHandler) RoutePattern ¶
func (h *GraphQLPlaygroundHandler) RoutePattern() string
type GrpcConfig ¶
type GrpcConfig struct {
ListenAddr string `mapstructure:"listen_addr" yaml:"listen_addr" validate:"required"`
}
type GrpcParams ¶
type GrpcParams struct { fx.In Config *GrpcConfig Broker pb.BrokerServer }
type HandlerRoute ¶
type OgentServerParams ¶
type Params ¶
type Params struct { fx.In Logger *zap.SugaredLogger `optional:"true"` ControllerRoutes []ControllerRoute `group:"controllerRoutes"` HandlerRoutes []HandlerRoute `group:"handlerRoutes"` OgentServer *ogent.Server }
type Result ¶
func (*Result) GetHttpRouter ¶
type SwaggerHandler ¶
type SwaggerHandler struct{}
func NewSwaggerHandler ¶
func NewSwaggerHandler() *SwaggerHandler
func (*SwaggerHandler) RegisterControllerRoutes ¶
func (h *SwaggerHandler) RegisterControllerRoutes(rg *gin.RouterGroup)
func (*SwaggerHandler) RoutePattern ¶
func (h *SwaggerHandler) RoutePattern() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.