Versions in this module Expand all Collapse all v0 v0.1.0 Dec 30, 2024 Changes in this version + const KeepAliveTime + const MaxConnectionAge + const MaxConnectionAgeGrace + func GetBufDialer(listener *bufconn.Listener) func(context.Context, string) (net.Conn, error) + func GetClientConn(ctx context.Context, addr string) (*grpc.ClientConn, error) + func NewClientMetricStreamInterceptor() grpc.StreamClientInterceptor + func NewClientMetricUnaryInterceptor() grpc.UnaryClientInterceptor + func NewMetricStreamInterceptor() grpc.StreamServerInterceptor + func NewMetricUnaryInterceptor() grpc.UnaryServerInterceptor + func NewRateLimitStreamClientInterceptor(rateLimiter Limiter) grpc.StreamClientInterceptor + func NewRateLimitStreamServerInterceptor(rateLimiter Limiter) grpc.StreamServerInterceptor + func NewRateLimitUnaryClientInterceptor(rateLimiter Limiter) grpc.UnaryClientInterceptor + func NewRateLimitUnaryServerInterceptor(rateLimiter Limiter) grpc.UnaryServerInterceptor + func NewRecoveryStreamInterceptor() grpc.StreamServerInterceptor + func NewRecoveryUnaryInterceptor() grpc.UnaryServerInterceptor + func NewRequestIDStreamClientInterceptor() grpc.StreamClientInterceptor + func NewRequestIDStreamServerInterceptor() grpc.StreamServerInterceptor + func NewRequestIDUnaryClientInterceptor() grpc.UnaryClientInterceptor + func NewRequestIDUnaryServerInterceptor() grpc.UnaryServerInterceptor + func NewTracingClientStreamInterceptor(opts ...otelgrpc.Option) grpc.StreamClientInterceptor + func NewTracingClientUnaryInterceptor(opts ...otelgrpc.Option) grpc.UnaryClientInterceptor + func NewTracingStreamInterceptor(opts ...otelgrpc.Option) grpc.StreamServerInterceptor + func NewTracingUnaryInterceptor(opts ...otelgrpc.Option) grpc.UnaryServerInterceptor + func TestClientConn(ctx context.Context, listener *bufconn.Listener, options []grpc.DialOption) (*grpc.ClientConn, error) + func TestServer(options []grpc.ServerOption) (*grpc.Server, *bufconn.Listener) + type ClientBuilder struct + func NewClientBuilder() *ClientBuilder + func (b *ClientBuilder) ClientConn(ctx context.Context, addr string) (*grpc.ClientConn, error) + func (b *ClientBuilder) TLSClientConn(ctx context.Context, addr string) (*grpc.ClientConn, error) + func (b *ClientBuilder) WithBlock() *ClientBuilder + func (b *ClientBuilder) WithClientTransportCredentials(insecureSkipVerify bool, certPool *x509.CertPool) *ClientBuilder + func (b *ClientBuilder) WithDefaultStreamInterceptors() *ClientBuilder + func (b *ClientBuilder) WithDefaultUnaryInterceptors() *ClientBuilder + func (b *ClientBuilder) WithInsecure() *ClientBuilder + func (b *ClientBuilder) WithKeepAliveParams(params keepalive.ClientParameters) *ClientBuilder + func (b *ClientBuilder) WithOptions(opts ...grpc.DialOption) *ClientBuilder + func (b *ClientBuilder) WithStreamInterceptors(interceptors ...grpc.StreamClientInterceptor) *ClientBuilder + func (b *ClientBuilder) WithUnaryInterceptors(interceptors ...grpc.UnaryClientInterceptor) *ClientBuilder + type Config struct + EnableReflection bool + GrpcHost string + GrpcPort int32 + MetricsEnabled bool + MetricsPort int + ServiceName string + TraceEnabled bool + TraceURL string + type ConnectionBuilder interface + GetConn func(ctx context.Context, addr string) (*grpc.ClientConn, error) + GetTLSConn func(ctx context.Context, addr string) (*grpc.ClientConn, error) + WithInsecure func() + WithKeepAliveParams func(params keepalive.ClientParameters) + WithOptions func(opts ...grpc.DialOption) + WithStreamInterceptors func(interceptors []grpc.StreamClientInterceptor) + WithUnaryInterceptors func(interceptors []grpc.UnaryClientInterceptor) + type InProcessServer interface + Cleanup func() + GetListener func() *bufconn.Listener + RegisterService func(reg func(*grpc.Server)) + Start func() error + type InProcessServerBuilder struct + func NewInProcessServerBuilder() *InProcessServerBuilder + func (sb *InProcessServerBuilder) Build() InProcessServer + func (sb *InProcessServerBuilder) WithOption(o grpc.ServerOption) *InProcessServerBuilder + func (sb *InProcessServerBuilder) WithStreamInterceptors(interceptors ...grpc.StreamServerInterceptor) *InProcessServerBuilder + func (sb *InProcessServerBuilder) WithTLSCert(cert *tls.Certificate) *InProcessServerBuilder + func (sb *InProcessServerBuilder) WithUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) *InProcessServerBuilder + type Limiter interface + Check func(ctx context.Context) bool + type RateLimiter struct + func NewRateLimiter(requestCount int, limitPeriod time.Duration) *RateLimiter + func (l *RateLimiter) Check(ctx context.Context) bool + type Server interface + AwaitTermination func(ctx context.Context) + GetListener func() net.Listener + GetServer func() *grpc.Server + Start func(ctx context.Context) error + Stop func(ctx context.Context) error + type ServerBuilder struct + func NewServerBuilder() *ServerBuilder + func NewServerBuilderFromConfig(cfg *Config) *ServerBuilder + func (sb *ServerBuilder) Build() (Server, error) + func (sb *ServerBuilder) WithDefaultKeepAlive() *ServerBuilder + func (sb *ServerBuilder) WithDefaultStreamInterceptors() *ServerBuilder + func (sb *ServerBuilder) WithDefaultUnaryInterceptors() *ServerBuilder + func (sb *ServerBuilder) WithHealthCheck(enabled bool) *ServerBuilder + func (sb *ServerBuilder) WithHost(host string) *ServerBuilder + func (sb *ServerBuilder) WithKeepAlive(serverParams keepalive.ServerParameters) *ServerBuilder + func (sb *ServerBuilder) WithMetricsEnabled(enabled bool) *ServerBuilder + func (sb *ServerBuilder) WithOption(o grpc.ServerOption) *ServerBuilder + func (sb *ServerBuilder) WithPort(port int) *ServerBuilder + func (sb *ServerBuilder) WithReflection(enabled bool) *ServerBuilder + func (sb *ServerBuilder) WithService(service serviceRegistry) *ServerBuilder + func (sb *ServerBuilder) WithServiceName(serviceName string) *ServerBuilder + func (sb *ServerBuilder) WithShutdownHook(fn ShutdownHook) *ServerBuilder + func (sb *ServerBuilder) WithStreamInterceptors(interceptors ...grpc.StreamServerInterceptor) *ServerBuilder + func (sb *ServerBuilder) WithTLSCert(cert *tls.Certificate) *ServerBuilder + func (sb *ServerBuilder) WithTraceURL(traceURL string) *ServerBuilder + func (sb *ServerBuilder) WithTracingEnabled(enabled bool) *ServerBuilder + func (sb *ServerBuilder) WithUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor) *ServerBuilder + type ShutdownHook func(ctx context.Context) error