srvgrpc

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheckModule

type HealthCheckModule struct{}

HealthCheckModule defines a grpc provider for container.Container.

func (HealthCheckModule) ProvideGRPC

func (h HealthCheckModule) ProvideGRPC(server *grpc.Server)

ProvideGRPC implements container.GRPCProvider

type MetricsModule

type MetricsModule struct{}

MetricsModule exposes prometheus metrics. Here only provides a simple call, more complex use, please refer to github.com/grpc-ecosystem/go-grpc-prometheus.

Need to actively provide grpc.Server:

opts := []grpc.ServerOption{
	grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
	grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
}
server = grpc.NewServer(opts...)

func (MetricsModule) ProvideGRPC

func (m MetricsModule) ProvideGRPC(server *grpc.Server)

ProvideGRPC implements container.GRPCProvider

Jump to

Keyboard shortcuts

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