Documentation
¶
Index ¶
- Variables
- func LoggingUnaryClientInterceptor(opts ...logging.Option) grpc.UnaryClientInterceptor
- func LoggingUnaryClientInterceptorFactory(logger *slog.Logger) func(opts ...logging.Option) grpc.UnaryClientInterceptor
- func LoggingUnaryServerInterceptor(opts ...logging.Option) grpc.UnaryServerInterceptor
- func LoggingUnaryServerInterceptorFactory(logger *slog.Logger) func(opts ...logging.Option) grpc.UnaryServerInterceptor
- func MetadataFromHeader(header http.Header, remoteAddr string) metadata.MD
- func SetupBufconnFactory(name string, dialOpts ...grpc.DialOption) func(lc *lifecycle.Lifecycle, listener Listener) (*grpc.ClientConn, error)
- func SetupBufconnListenerFactory(name string) func(lc *lifecycle.Lifecycle) (Listener, error)
- func SetupConnFactory(name string, dialOpts ...grpc.DialOption) func(lc *lifecycle.Lifecycle, conf *ConnConfig) (*grpc.ClientConn, error)
- func SetupServerFactory(name string, opts ...grpc.ServerOption) ...
- type ConnConfig
- type Listener
- type LoadBalancingPolicy
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var SetupBufconnListener = SetupBufconnListenerFactory("bufconn-listener")
Functions ¶
func LoggingUnaryClientInterceptor ¶
func LoggingUnaryClientInterceptor(opts ...logging.Option) grpc.UnaryClientInterceptor
func LoggingUnaryServerInterceptor ¶
func LoggingUnaryServerInterceptor(opts ...logging.Option) grpc.UnaryServerInterceptor
func MetadataFromHeader ¶
func SetupBufconnFactory ¶
func SetupBufconnFactory(name string, dialOpts ...grpc.DialOption) func(lc *lifecycle.Lifecycle, listener Listener) (*grpc.ClientConn, error)
func SetupConnFactory ¶
func SetupConnFactory(name string, dialOpts ...grpc.DialOption) func(lc *lifecycle.Lifecycle, conf *ConnConfig) (*grpc.ClientConn, error)
func SetupServerFactory ¶
Types ¶
type ConnConfig ¶
type ConnConfig struct {
Address string `confx:"address" validate:"required" usage:"gRPC server address"`
LoadBalancingPolicy LoadBalancingPolicy `` /* 129-byte string literal not displayed */
}
type Listener ¶
func SetupListener ¶
func SetupListener(lc *lifecycle.Lifecycle, conf *ServerConfig) (Listener, error)
type LoadBalancingPolicy ¶
type LoadBalancingPolicy string
const ( // pick-first is the default load balancing policy LoadBalancingPolicyPickFirst LoadBalancingPolicy = "pick-first" // round-robin should be used with dns:///address and the target address should be a k8s headless service LoadBalancingPolicyRoundRobin LoadBalancingPolicy = "round-robin" )
type ServerConfig ¶
Click to show internal directories.
Click to hide internal directories.