transport

package
v0.0.0-...-bcec15c Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AsControllerRoute

func AsControllerRoute(controller any) any

func AsHandlerRoute

func AsHandlerRoute(handler any) any

func NewGrpc

func NewGrpc(p GrpcParams) *grpc.Server

func NewHttp

func NewHttp(config *Config, router *gin.Engine) *http.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

type GraphQLHandler struct {
	EntClient *ent.Client
}

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 GraphQLParams

type GraphQLParams struct {
	fx.In
	EntClient *ent.Client
}

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 HandlerRoute interface {
	HttpHandler() http.Handler
	RoutePattern() string
}

type OgentServerParams

type OgentServerParams struct {
	fx.In
	EntClient          *ent.Client
	HealthzCountroller *healthz.Controller
}

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

type Result struct {
	fx.Out
	Http *gin.Engine
}

func NewRouter

func NewRouter(p Params) Result

func (*Result) GetHttpRouter

func (r *Result) GetHttpRouter() *gin.Engine

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

Jump to

Keyboard shortcuts

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