grpc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *options)

func WithServerCredentials

func WithServerCredentials(certFile, keyFile string) Option

WithServerCredentials 设置证书和秘钥

func WithServerListenAddr

func WithServerListenAddr(addr string) Option

func WithServerOptions

func WithServerOptions(opts ...grpc.ServerOption) Option

type Server

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

func NewServer

func NewServer(opts ...Option) *Server

func (*Server) Addr

func (s *Server) Addr() string

Addr 监听地址

func (*Server) Endpoint

func (s *Server) Endpoint() *endpoint.Endpoint

Endpoint 获取服务端口

func (*Server) RegisterService

func (s *Server) RegisterService(sd *grpc.ServiceDesc, ss interface{})

RegisterService 注册服务

func (*Server) Scheme

func (s *Server) Scheme() string

Scheme 协议

func (*Server) Start

func (s *Server) Start() error

Start 启动服务器

func (*Server) Stop

func (s *Server) Stop() error

Stop 停止服务器

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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