client

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

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