serverutil

package
v0.3.18 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 18 Imported by: 14

README

Server

Server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInOneServer

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

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

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

Jump to

Keyboard shortcuts

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