comm

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: Apache-2.0 Imports: 7 Imported by: ? 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 {
	TLSCertHash []byte
	*comm.GRPCClient
}

Client deals with TLS connections to the discovery server

func NewClient

func NewClient(conf Config) (*Client, error)

NewClient creates a new comm client out of the given configuration

func (*Client) NewDialer

func (c *Client) NewDialer(endpoint string) func() (*grpc.ClientConn, error)

NewDialer creates a new dialer from the given endpoint

type Config

type Config struct {
	CertPath       string
	KeyPath        string
	PeerCACertPath string
	Timeout        time.Duration
}

Config defines configuration of a Client

func (Config) ToSecureOptions

func (conf Config) ToSecureOptions(newSelfSignedTLSCert genTLSCertFunc) (comm.SecureOptions, error)

ToSecureOptions converts this Config to SecureOptions. The given function generates a self signed client TLS certificate if the TLS certificate and key aren't present at the config

Jump to

Keyboard shortcuts

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