client

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client grpc client definition

func New

func New(config *config.ClientConfig) *Client

New returns a Client instance

func (*Client) ChainUnaryClient

func (c *Client) ChainUnaryClient() grpc.UnaryClientInterceptor

ChainUnaryClient creates a single interceptor out of a chain of many interceptors. Execution is done in left-to-right order, including passing of context. For example ChainUnaryClient(one, two, three) will execute one before two before three.

func (*Client) GetBreakers

func (c *Client) GetBreakers() *breaker.BreakerGroup

GetConn return the client breakers

func (*Client) GetConn

func (c *Client) GetConn() *grpc.ClientConn

GetConn return the client connection

func (*Client) Use

func (c *Client) Use(interceptors ...grpc.UnaryClientInterceptor)

Use attaches a global interceptor to the client. ie. the interceptor attached through Use() will be included in the interceptors chain for every single request. For example, this is the right place for a logger or error management interceptor.

func (*Client) WithUnaryServerChain

func (c *Client) WithUnaryServerChain() grpc.DialOption

Chain creates a single interceptor out of a chain of many interceptors. WithUnaryServerChain is a grpc.Client dial option that accepts multiple unary interceptors. Basically syntactic sugar.

Jump to

Keyboard shortcuts

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