Documentation ¶
Overview ¶
Package grpcserverutil contains utilities for running gRPC servers.
TODO(reddaly): Rename package gcputil.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialSecure ¶
func DialSecure[T any](ctx context.Context, addr string, factory func(conn *grpc.ClientConn) (T, error)) (T, error)
DialSecure dials a gRPC service securely using the system cert pool and calls the factory method to construct a client.
func ServeUntilCancelled ¶
ServeUntilCancelled calls server.Serve until the provided context is cancelled. When cancellation occurs, server.GracefulStop is called.
func SystemTLSCredentials ¶
func SystemTLSCredentials() (credentials.TransportCredentials, error)
SystemTLSCredentials returns the standard transport credentials for connecting to a TLS server.
Types ¶
type Address ¶
type Address[ClientT any] struct { // contains filtered or unexported fields }
Address is primarily used for defining flags that can be used to instantiate gRPC clients.
func AddressFlag ¶
func AddressFlag[ClientT any]( name string, defaultVal string, usage string, factory func(ctx context.Context, conn *grpc.ClientConn) (ClientT, error)) *Address[ClientT]
AddressFlag defines a new flag of type Address[ClientT].
Click to show internal directories.
Click to hide internal directories.