Documentation ¶
Index ¶
- type Client
- type Option
- func WithBalancerName(name string) Option
- func WithDiscovery(discovery sd.Discovery) Option
- func WithEnabledHealthCheck(enabledHealthCheck bool) Option
- func WithGRPCOptions(opts ...grpc.DialOption) Option
- func WithLogger(logger xlog.Logger) Option
- func WithMiddlewares(mws ...middleware.Middleware) Option
- func WithTLSConfig(tls *tls.Config) Option
- func WithTimeout(timeout time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { *grpc.ClientConn // contains filtered or unexported fields }
Client is a grpc client.
func (*Client) Use ¶
func (c *Client) Use(selector string, mws ...middleware.Middleware)
Use adds middlewares to the client. selector support /, /{package} /{package}.{service}, /{package}.{service}/{method}
type Option ¶
type Option func(o *options)
Option is a function that configures the client.
func WithBalancerName ¶
WithBalancerName returns an Option that sets the balancer name of the client.
func WithDiscovery ¶
WithDiscovery returns an Option that sets the discoverer of the client.
func WithEnabledHealthCheck ¶
WithEnabledHealthCheck returns an Option that sets the health check of the client.
func WithGRPCOptions ¶
func WithGRPCOptions(opts ...grpc.DialOption) Option
WithGRPCOptions returns an Option that sets the grpc options of the client.
func WithLogger ¶
WithLogger returns an Option that sets the logger of the client.
func WithMiddlewares ¶
func WithMiddlewares(mws ...middleware.Middleware) Option
WithMiddlewares returns an Option that sets the middlewares of the client.
func WithTLSConfig ¶
WithTLSConfig returns an Option that sets the tls config of the client.
func WithTimeout ¶
WithTimeout returns an Option that sets the timeout of the client.