Documentation ¶
Index ¶
- func BalancerOption() grpc.DialOption
- func Block() grpc.DialOption
- func Insecure() grpc.DialOption
- func WithDiscovery(discoverer register.IDiscovery) grpc.DialOption
- func WithUnaryClientInterceptors(interceptors ...grpc.UnaryClientInterceptor) grpc.DialOption
- func WithUnaryServerInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption
- type COption
- type Client
- type IClient
- type RegisterServer
- type SOption
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BalancerOption ¶
func BalancerOption() grpc.DialOption
func Block ¶
func Block() grpc.DialOption
func Insecure ¶
func Insecure() grpc.DialOption
func WithDiscovery ¶
func WithDiscovery(discoverer register.IDiscovery) grpc.DialOption
WithDiscovery 注册非全局的服务发现,此优先级高于全局注册
func WithUnaryClientInterceptors ¶
func WithUnaryClientInterceptors(interceptors ...grpc.UnaryClientInterceptor) grpc.DialOption
WithUnaryClientInterceptors 按顺序加载拦截器 WithChainUnaryInterceptor 是一个按照顺序来的 WithUnaryInterceptor 总是在最前面
func WithUnaryServerInterceptors ¶
func WithUnaryServerInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption
Types ¶
type COption ¶
type COption func(*[]grpc.DialOption)
func WithDialOption ¶
func WithDialOption(opts ...grpc.DialOption) COption
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Coon ¶
func (c *Client) Coon() *grpc.ClientConn
type IClient ¶
type IClient interface {
Coon() *grpc.ClientConn
}
func MustNewClient ¶
MustNewClient 新建一个 Client 实例
type RegisterServer ¶
type SOption ¶
type SOption func(*[]grpc.ServerOption)
func WithServerOption ¶
func WithServerOption(opts ...grpc.ServerOption) SOption
type Server ¶
type Server struct { ServiceInstance *register.ServiceInstance // contains filtered or unexported fields }
func MustNewServer ¶
func MustNewServer(ctx context.Context, server rpc.Server, registerServer RegisterServer, serverOption ...grpc.ServerOption) *Server
func (*Server) BuildServerOption ¶
func (s *Server) BuildServerOption() grpc.ServerOption
BuildServerOption 构建服务端拦截器
Click to show internal directories.
Click to hide internal directories.