Grpc

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(fs ...GrpcAttrFunc) *grpc.ClientConn

func NewServer

func NewServer(fs ...GrpcAttrFunc) *grpc.Server

func RecoveryInterceptor

func RecoveryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

Types

type Grpc

type Grpc struct {
	KeyPath           string
	ChainStreamServer []grpc.StreamServerInterceptor
	ChainServer       []grpc.UnaryServerInterceptor
	Ip                string
	Host              string
	Selector          int
	ServerName        string
	ClientIp          string
	Etcdctl           *Etcd.EtcdCtl
}

func (*Grpc) GetClientcert

func (this *Grpc) GetClientcert(path string, host string) credentials.TransportCredentials

func (*Grpc) GetServercert

func (this *Grpc) GetServercert(path string) credentials.TransportCredentials

func (*Grpc) Name added in v1.0.5

func (this *Grpc) Name() string

type GrpcAttrFunc

type GrpcAttrFunc func(grpc *Grpc) //设置User属性的 函数类型

func Host

func Host(host string) GrpcAttrFunc

func Ip

func Ip(ip string) GrpcAttrFunc

func KeyPath

func KeyPath(path string) GrpcAttrFunc

func ServerInterceptor

func ServerInterceptor(fn grpc.UnaryServerInterceptor) GrpcAttrFunc

func StreamServerInterceptor

func StreamServerInterceptor(fn grpc.StreamServerInterceptor) GrpcAttrFunc

func WithEtcd added in v1.0.5

func WithEtcd(name string, selector int, clientIp string) GrpcAttrFunc

type GrpcAttrFuncs

type GrpcAttrFuncs []GrpcAttrFunc

Jump to

Keyboard shortcuts

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