rpc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainUnaryServer

func ChainUnaryServer(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor

ChainUnaryServer 链式一元拦截器(多拦截器)

func EtcdRegister

func EtcdRegister(etcdHost, serviceName, addr string, ttl int64) error

EtcdRegister etcd注册

func EtcdUnRegister

func EtcdUnRegister(serviceName, addr string) error

EtcdUnRegister etcd删除

func LogUnaryServerInterceptor

func LogUnaryServerInterceptor() grpc.UnaryServerInterceptor

LogUnaryServerInterceptor 日志拦截器

func NewClient

func NewClient(tls *Tls, addr string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)

NewClient 构造rpc客户端

Types

type Server

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

func NewServer

func NewServer(tls *Tls, opt ...grpc.ServerOption) *Server

NewServer 构造rpc服务端

func (*Server) Run

func (s *Server) Run(addr string) error

Run grpc的调用

func (*Server) Server

func (s *Server) Server() (server *grpc.Server, err error)

Server 添加Server服务,tls

func (*Server) Use

func (s *Server) Use(middleware ...grpc.UnaryServerInterceptor)

Use 拦截器

type Tls

type Tls struct {
	Crt   string
	Key   string
	CACrt string
}

Jump to

Keyboard shortcuts

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