Documentation
¶
Index ¶
- func NewClient(fs ...GrpcAttrFunc) *grpc.ClientConn
- func NewServer(fs ...GrpcAttrFunc) *grpc.Server
- func RecoveryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- type Grpc
- type GrpcAttrFunc
- func Host(host string) GrpcAttrFunc
- func Ip(ip string) GrpcAttrFunc
- func KeyPath(path string) GrpcAttrFunc
- func ServerInterceptor(fn grpc.UnaryServerInterceptor) GrpcAttrFunc
- func StreamServerInterceptor(fn grpc.StreamServerInterceptor) GrpcAttrFunc
- func WithEtcd(name string, selector int, clientIp string) GrpcAttrFunc
- type GrpcAttrFuncs
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
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
type GrpcAttrFuncs ¶
type GrpcAttrFuncs []GrpcAttrFunc
Click to show internal directories.
Click to hide internal directories.