Documentation ¶
Index ¶
- Constants
- func GetClientCredByBytes(crt, key, ca []byte, servername string) (cred credentials.TransportCredentials, err error)
- func GetClientCredByFile(crt, key, ca, servername string) (cred credentials.TransportCredentials, err error)
- func GetServerCredByBytes(crt, key, ca []byte) (cred credentials.TransportCredentials, err error)
- func GetServerCredByFile(crt, key, ca string) (cred credentials.TransportCredentials, err error)
- func NewRpcClient(opts ...Option) (cc *grpc.ClientConn, err error)
- type Option
- func WithAddr(addr string) Option
- func WithCa(ca []byte) Option
- func WithCaFile(ca string) Option
- func WithCert(cert []byte) Option
- func WithCertFile(cert string) Option
- func WithDialOption(dialOption ...grpc.DialOption) Option
- func WithKey(key []byte) Option
- func WithKeyFile(key string) Option
- func WithSecurity(security bool) Option
- func WithServerName(servername string) Option
- func WithTimeout(duration time.Duration) Option
- type Options
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 WithCaFile ¶
func WithCertFile ¶
func WithDialOption ¶
func WithDialOption(dialOption ...grpc.DialOption) Option
func WithKeyFile ¶
func WithSecurity ¶
func WithServerName ¶
func WithTimeout ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func DefaultOpts ¶
func DefaultOpts() *Options
Click to show internal directories.
Click to hide internal directories.