server

package
v0.0.0-...-9cf7771 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPTimeoutReadDefault  = 10
	HTTPTimeoutWriteDefault = 10
)

Variables

View Source
var ErrGrpcExecPanic = errors.New("grpc exec panic")

Functions

func AddGracefulStop

func AddGracefulStop(fn func())

func GinLoggerHandler

func GinLoggerHandler() gin.HandlerFunc

func GinRecoverHandler

func GinRecoverHandler() gin.HandlerFunc

func NewGinAPIHandler

func NewGinAPIHandler(initRoute func(r *gin.Engine)) http.Handler

Types

type GrpcConfig

type GrpcConfig struct {
	Addr    string
	Timeout int64
}

type GrpcServer

type GrpcServer struct {
	// contains filtered or unexported fields
}

func NewGrpcServer

func NewGrpcServer(conf GrpcConfig, registerServerFunc func(*grpc.Server), interceptors ...grpc.UnaryServerInterceptor) (*GrpcServer, error)

func (*GrpcServer) Start

func (s *GrpcServer) Start()

func (*GrpcServer) Stop

func (s *GrpcServer) Stop()

type HTTPConfig

type HTTPConfig struct {
	Addr         string
	TimeoutRead  int64
	TimeoutWrite int64
}

type HTTPService

type HTTPService struct {
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(conf HTTPConfig, handler http.Handler) (*HTTPService, error)

func (*HTTPService) Start

func (s *HTTPService) Start()

func (*HTTPService) Stop

func (s *HTTPService) Stop()

type Server

type Server interface {
	Start()
	Stop()
}

type Servers

type Servers struct {
	// contains filtered or unexported fields
}

func (*Servers) Add

func (s *Servers) Add(server Server)

func (*Servers) Start

func (s *Servers) Start()

func (*Servers) Stop

func (s *Servers) Stop()

Jump to

Keyboard shortcuts

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