grpcutils

package
v0.20.7 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultMaxMsgSize = 1024 * 1024 * 16

DefaultMaxMsgSize use 16MB as the default message size limit. grpc library default is 4MB

Variables

This section is empty.

Functions

func DefaultClientTLSConfig added in v0.20.0

func DefaultClientTLSConfig(publicKey crypto.PublicKey) (*tls.Config, error)

DefaultClientTLSConfig returns the default TLS client config with the given public key for a secure GRPC client The TLSConfig verifies that the server certifcate is valid and has the correct signature

func DefaultServerTLSConfig added in v0.20.0

func DefaultServerTLSConfig(cert *tls.Certificate) *tls.Config

DefaultServerTLSConfig returns the default TLS server config with the given cert for a secure GRPC server

func IsServerAuthError added in v0.20.0

func IsServerAuthError(err error) bool

IsServerAuthError checks if the input error is of a ServerAuthError type

func X509Certificate added in v0.20.0

func X509Certificate(privKey crypto.PrivateKey) (*tls.Certificate, error)

X509Certificate generates a self-signed x509 TLS certificate from the given key. The generated certificate includes a libp2p extension that specifies the public key and the signature. The certificate does not include any SAN extension.

Types

type ServerAuthError added in v0.20.0

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

ServerAuthError is an error returned when the server authentication fails

func (ServerAuthError) Error added in v0.20.0

func (e ServerAuthError) Error() string

Jump to

Keyboard shortcuts

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