grpc

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package grpc provides basic gRPC functions.

Package grpc provides basic gRPC functions.

Package grpc provides basic gRPC functions.

Package grpc provides basic gRPC functions.

Package grpc provides basic gRPC functions.

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 object capable of interacting with Client

func New

func New(ctx context.Context, log *logger.Zerolog) *Client

New creates a new Client

func (*Client) AddImport

func (c *Client) AddImport(path ...string)

AddImport adds import paths

func (*Client) AddProtobuf

func (c *Client) AddProtobuf(path ...string)

AddProtobuf adds protobuf files

func (*Client) CancelQuery

func (c *Client) CancelQuery()

CancelQuery aborting a running gRPC request

func (*Client) Close

func (c *Client) Close()

Close closes connection to gRPC server

func (*Client) CloseStream added in v0.3.14

func (c *Client) CloseStream()

CloseStream stops a running gRPC stream

func (*Client) Connect

func (c *Client) Connect(addr string, auth *entity.Auth, opts ...ClientOpt) error

Connect connecting to gRPC server

func (*Client) GetResponseChannel added in v0.3.14

func (c *Client) GetResponseChannel() chan *entity.QueryResponse

GetResponseChannel returns response channel

func (*Client) GetSentCounter added in v0.3.14

func (c *Client) GetSentCounter() uint

GetSentCounter returns sent messages counter

func (*Client) LoadFromProtobuf

func (c *Client) LoadFromProtobuf() ([]*entity.Service, []*entity.ProtobufError, *entity.ProtobufError)

LoadFromProtobuf loads services from protobuf

func (*Client) LoadFromReflection

func (c *Client) LoadFromReflection() ([]*entity.Service, error)

LoadFromReflection loads services using reflection

func (*Client) Query

func (c *Client) Query(method *entity.Method, data map[string]interface{}, metadata []string) error

Query executes a gRPC request

func (*Client) SetSettings added in v0.3.14

func (c *Client) SetSettings(cfg *entity.Settings)

SetSettings sets application settings

type ClientOpt

type ClientOpt func(options *ClientOptions)

ClientOpt represents Client option

func WithClientCertificate

func WithClientCertificate(cert string) ClientOpt

WithClientCertificate returns ClientOpt which sets client certificate

func WithClientKey

func WithClientKey(key string) ClientOpt

WithClientKey returns ClientOpt which sets client certificate private key

func WithInsecure

func WithInsecure() ClientOpt

WithInsecure returns ClientOpt which disables server certificate chain verification and hostname

func WithNoTLS

func WithNoTLS() ClientOpt

WithNoTLS returns ClientOpt which disables transport security

func WithRootCertificate

func WithRootCertificate(cert string) ClientOpt

WithRootCertificate returns ClientOpt which sets server CA certificate

type ClientOptions

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

ClientOptions represents Client options

Jump to

Keyboard shortcuts

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