rpc

package
v0.0.0-...-4ea7438 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient()

func StartClient

func StartClient(ip, port string) (conn *grpc.ClientConn, err error)

StartClient 创建grpc客户端

func StartServer

func StartServer(port string, callbackService func(server *grpc.Server))

StartServer 启动grpc服务 并注册服务

Types

type Client

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

func (*Client) AddService

func (c *Client) AddService(regClient func(c *grpc.ClientConn))

func (*Client) GetClient

func (c *Client) GetClient() *grpc.ClientConn

func (*Client) Start

func (c *Client) Start()

type Server

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

Server Server

func NewServer

func NewServer(rpcConf ServerConf) *Server

NewServer NewServer

func (*Server) AddService

func (s *Server) AddService(regService func(s *grpc.Server))

AddService 注册服务。。。

func (*Server) GetServer

func (s *Server) GetServer() *grpc.Server

GetServer GetServer

func (*Server) Start

func (s *Server) Start()

Start Start

func (*Server) Stop

func (s *Server) Stop()

Stop Stop

func (*Server) Use

func (s *Server) Use(handler interface{})

Use Use

type ServerConf

type ServerConf struct {
	Host string
	Port int
}

ServerConf ServerConf

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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