serverlib

package
v1.1.97 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(fns ...func() error)

Watch 监听信号

Types

type Server added in v1.1.82

type Server struct {
	health.Server
	GRPCServer *grpc.Server // gRPC server
	HTTPServer *http.Server // if you need gRPC gw,please use it
}

Server represents the microservice.

func NewServer added in v1.1.82

func NewServer() *Server

NewServer new server

func (*Server) Start added in v1.1.82

func (s *Server) Start(ctx context.Context, router func(r *gin.Engine)) error

Start starts the microservice with listening on the ports start grpc gateway and http server on different port

func (*Server) StopServer added in v1.1.82

func (s *Server) StopServer(ctx context.Context) error

StopServer stops the microservice gracefully.

Jump to

Keyboard shortcuts

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