grpc

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

Jump to

Keyboard shortcuts

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