app

package
v0.0.0-...-85da37a Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitApp

func InitApp()

func NewContext

func NewContext() context.Context

NewContext 生成一个新的Context

func RegisterService

func RegisterService(svc Service)

RegisterService 将用户的gRPC Service注册到Server。

Types

type Server

type Server struct {
	net.Listener
	GRPCServer *grpc.Server
	// contains filtered or unexported fields
}

GRPC Server封装

func New

func New(addr string) *Server

New 返回一个GRPC Server实例

func (*Server) Run

func (s *Server) Run() (err error)

Run 启动Server 你可以监听系统信号量并调用Shutdown来优雅关闭Server

func (*Server) Shutdown

func (s *Server) Shutdown()

Shudown 停止实例

type Service

type Service struct {
	Name     string
	Desc     string
	Enabled  bool
	Register func(*grpc.Server)
}

Service 对用户注册的gRPC Service进行了封装。

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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