Documentation ¶
Index ¶
- func AuthUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func ChainStreamServer(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
- func ChainUnaryServer(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- func EtcdRegister(etcdHost, serviceName, addr string, ttl int64) error
- func EtcdUnRegister(serviceName, addr string) error
- func LogUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func NewClient(tls *Tls, addr string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)
- type Server
- type Tls
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthUnaryServerInterceptor ¶
func AuthUnaryServerInterceptor() grpc.UnaryServerInterceptor
func ChainStreamServer ¶
func ChainStreamServer(interceptors ...grpc.StreamServerInterceptor) grpc.StreamServerInterceptor
流式拦截器 ChainStreamServer creates a single interceptor out of a chain of many interceptort.
Execution is done in left-to-right order, including passing of context. For example ChainUnaryServer(one, two, three) will execute one before two before three. If you want to pass context between interceptors, use WrapServerStream.
While this can be useful in some scenarios, it is generally advisable to use google.golang.org/grpc.ChainStreamInterceptor directly.
func ChainUnaryServer ¶
func ChainUnaryServer(interceptors ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
构建支持多个拦截器中间件
func EtcdRegister ¶
func EtcdUnRegister ¶
func LogUnaryServerInterceptor ¶
func LogUnaryServerInterceptor() grpc.UnaryServerInterceptor
func NewClient ¶
func NewClient(tls *Tls, addr string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func GetRpcServer ¶
func GetRpcServer(tls *Tls, opt ...grpc.ServerOption) *Server
Click to show internal directories.
Click to hide internal directories.