Documentation

Index

Constants

This section is empty.

Variables

var ErrInvalidScheme = errors.New("unsupported URL scheme")

ErrInvalidScheme is returned when provided URL has an unsupported scheme. Supported schemes are "grpc" or "grpc+tls".


Functions

This section is empty.

Types

type Client

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

Client is a wrapper around gRPC connection that implements StarterStopper and Healthcheck interfaces.

func NewClient

func NewClient(name string, u url.URL) (*Client, error)

NewClient returns a new instance of GRPCClient.

func (*Client) Close

func (c *Client) Close() error

Close closes the client by closing gRPC connection.

func (*Client) Conn

func (c *Client) Conn() (*grpc.ClientConn, error)

Conn checks the underlying gRPC client connection for readiness and returns it. If connection is not established or is not ready, an error is returned instead.

func (*Client) Dial

func (c *Client) Dial(ctx context.Context) error

Dial starts the client by establishing gRPC connection.

func (*Client) Invoke

func (c *Client) Invoke(ctx context.Context, method string, args, res interface{}, opts ...grpc.CallOption) error

Invoke invokes a unary gRPC call through the underlying connection.

Source Files