grpcx

package
v0.0.0-...-2542f7f Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(parent context.Context, addr string, timeout time.Duration, sets ...DialOption) (*grpc.ClientConn, context.CancelFunc, error)

func TCPConnectOK

func TCPConnectOK(timeout time.Duration, addr string) error

TCPConnectOK returns an error if it was not possible to connect to the server.

Types

type DialOption

type DialOption func(opts *DialOptions)

func AddStdGRPCOptions

func AddStdGRPCOptions(std ...grpc.DialOption) DialOption

func Fingerprint

func Fingerprint(in string) DialOption

func PlainText

func PlainText() DialOption

func SkipTLSVerify

func SkipTLSVerify() DialOption

type DialOptions

type DialOptions struct {
	// if true then disabled TLS
	PlainText bool
	// skips certificate verification
	SkipTLSVerify bool
	// if set then checks fingerprint the server cert
	Fingerprint string
	// standart grpc opts
	GRPCOptions []grpc.DialOption
}

type ManualVerifyPeerCertificate

type ManualVerifyPeerCertificate struct {
	DNSName       string
	SkipTLSVerify bool

	// checker of fingerprint from server cert
	Fingerprint SHA1Fingerprint
	// contains filtered or unexported fields
}

func NewManualVerifyPeerCertificate

func NewManualVerifyPeerCertificate(tlsSkip bool, fingerprint, dnsName string) *ManualVerifyPeerCertificate

func (ManualVerifyPeerCertificate) VerifyPeerCertificateOption

func (v ManualVerifyPeerCertificate) VerifyPeerCertificateOption(ctx context.Context, cancel context.CancelFunc) func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error

type SHA1Fingerprint

type SHA1Fingerprint string

func (SHA1Fingerprint) Empty

func (s SHA1Fingerprint) Empty() bool

func (SHA1Fingerprint) Match

func (s SHA1Fingerprint) Match(in []byte) bool

Jump to

Keyboard shortcuts

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