serverutil

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

README

Server

Server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInOneServer added in v0.0.9

func AllInOneServer(
	configFilePath string,
	configOpts []configutil.Option,
	services []ServiceExporter,
	authWhitelist []map[string]middlewareutil.TransportServiceKind,
) (*kratos.App, func(), error)

func GetApp

func GetApp(serverManager ServerManager) (*kratos.App, error)

func GetGRPCServer

func GetGRPCServer(serverManager ServerManager) (*grpc.Server, error)

func GetHTTPServer

func GetHTTPServer(serverManager ServerManager) (*http.Server, error)

func NewApp

func NewApp(launcherManager setuputil.LauncherManager, hs *http.Server, gs *grpc.Server) (*kratos.App, error)

NewApp .

func NewGRPCServer

func NewGRPCServer(
	launcherManager setuputil.LauncherManager,
	authWhiteList map[string]middlewareutil.TransportServiceKind,
) (*grpc.Server, error)

NewGRPCServer new a gRPC server.

func NewHTTPServer

func NewHTTPServer(
	launcherManager setuputil.LauncherManager,
	authWhiteList map[string]middlewareutil.TransportServiceKind,
) (*http.Server, error)

NewHTTPServer new HTTP server.

func RunServer added in v0.0.8

func RunServer(app *kratos.App, cleanup func())

Types

type ServerManager

type ServerManager interface {
	GetApp() (*kratos.App, error)
	GetHTTPServer() (*http.Server, error)
	GetGRPCServer() (*grpc.Server, error)
}

func NewServerManager

func NewServerManager(launcherManager setuputil.LauncherManager, authWhiteList map[string]middlewareutil.TransportServiceKind) (ServerManager, error)

type ServiceExporter added in v0.0.8

type ServiceExporter func(launcherManager setuputil.LauncherManager, serverManager ServerManager) (ServiceInterface, error)

type ServiceInterface added in v0.0.8

type ServiceInterface interface {
	// GetServices 暂时没有想好应用场景
	GetServices() []interface{}
	// GetCleanup 关闭
	GetCleanup() func()
}

func NewServiceInterface added in v0.0.8

func NewServiceInterface(cleanup func(), services ...interface{}) ServiceInterface

Jump to

Keyboard shortcuts

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