comm

package
v0.0.0-...-523a819 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 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
}

客户端处理TLS连接 到发现服务器

func NewClient

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

new client根据给定的配置创建新的通信客户端

func (*Client) NewDialer

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

NewDialer从给定的端点创建一个新的拨号程序

type Config

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

config定义客户端的配置

func (Config) ToSecureOptions

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

ToSecureOptions将此配置转换为SecureOptions。 如果 配置中不存在TLS证书和密钥

Jump to

Keyboard shortcuts

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