grpc_healthcheck

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHealthCheck

func RegisterHealthCheck(server *grpc.Server)

这个是在开启grpc health check, 本身grpc 就支持健康检查协议, 如果k8s能直接调同的话 use grpc_health_probe 那就只用调用这个方法就好了

func RegisterHealthCheckWithGin

func RegisterHealthCheckWithGin(grpcPort string, engine *gin.Engine)

这是一个wrap 方法, 开启一个gin,可以同http的方法去调用grpc的健康检查,注意: 必须启动完grpc server 后才能调用 先决条件: 1. 开启了grpc health check, 已经调用了 RegisterHealthCheck 2. grpc server 已经Serve起来了 如果不遵循先决条件,可能会panic

Types

This section is empty.

Jump to

Keyboard shortcuts

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