comm

package
v0.0.0-...-c1b8420 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 7 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 {
	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