grpc

package
v0.0.0-...-edf464d Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientOptions

func ClientOptions(options *istiokeepalive.Options, tlsOpts *TLSOptions) ([]grpc.DialOption, error)

ClientOptions returns consistent grpc dial options with custom dial options

func ServerOptions

func ServerOptions(options *istiokeepalive.Options, interceptors ...grpc.UnaryServerInterceptor) []grpc.ServerOption

Types

type ErrorType

type ErrorType string
const (
	// This indicates all the errors except the expected errors or graceful termination.
	UnexpectedError ErrorType = "unexpectedError"
	// This indicates an expected error when things are operating normally.
	ExpectedError ErrorType = "expectedError"
	// This indicates an error which happen when the connection is gracefully terminated.
	// For example, the peer calls `SendClose()`.
	GracefulTermination ErrorType = "gracefulTermination"
)

func GRPCErrorType

func GRPCErrorType(err error) ErrorType

GRPCErrorType checks a gRPC error code and determines its ErrorType. This is basically capturing when the peer disconnects.

type TLSOptions

type TLSOptions struct {
	RootCert      string
	Key           string
	Cert          string
	ServerAddress string
	SAN           string
}

TLSOptions include TLS options that a grpc client uses to connect with server.

Jump to

Keyboard shortcuts

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