client

package
v0.0.0-...-298ae05 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Server_crt = `` /* 1108-byte string literal not displayed */

	Server_key = `` /* 1680-byte string literal not displayed */

	Client_crt = `` /* 1108-byte string literal not displayed */

	Client_key = `` /* 1680-byte string literal not displayed */

	Ca_crt = `` /* 1224-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func GetClientCredByBytes

func GetClientCredByBytes(crt, key, ca []byte, servername string) (cred credentials.TransportCredentials, err error)

func GetClientCredByFile

func GetClientCredByFile(crt, key, ca, servername string) (cred credentials.TransportCredentials, err error)

func GetServerCredByBytes

func GetServerCredByBytes(crt, key, ca []byte) (cred credentials.TransportCredentials, err error)

func GetServerCredByFile

func GetServerCredByFile(crt, key, ca string) (cred credentials.TransportCredentials, err error)

func NewRpcClient

func NewRpcClient(opts ...Option) (cc *grpc.ClientConn, err error)

Types

type Option

type Option func(opts *Options)

func WithAddr

func WithAddr(addr string) Option

func WithCa

func WithCa(ca []byte) Option

func WithCaFile

func WithCaFile(ca string) Option

func WithCert

func WithCert(cert []byte) Option

func WithCertFile

func WithCertFile(cert string) Option

func WithDialOption

func WithDialOption(dialOption ...grpc.DialOption) Option

func WithKey

func WithKey(key []byte) Option

func WithKeyFile

func WithKeyFile(key string) Option

func WithSecurity

func WithSecurity(security bool) Option

func WithServerName

func WithServerName(servername string) Option

func WithTimeout

func WithTimeout(duration time.Duration) Option

type Options

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

func DefaultOpts

func DefaultOpts() *Options

Jump to

Keyboard shortcuts

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