Documentation
¶
Index ¶
- Constants
- Variables
- func CheckCtlHealthyStat(healthType string) error
- func CheckGrpcHealthy(grpcAddr, checkType string) error
- func CheckHttpHealthyStat(url string, checkType string) error
- func CheckerFuncRun(checkType string) error
- func RegLivenessCheckers(checkers ...Checker)
- func RegReadinessCheckers(checkers ...Checker)
- func RegStartupCheckers(checkers ...Checker)
- func SetGrpcHealthy(grpcAddr string, checkType string, status bool) error
- func SetGrpcHealthyClose(grpcAddr string, checkType string) error
- func SetGrpcHealthyOpen(grpcAddr string, checkType string) error
- func SetHttpHealthy(url string, checkType string, status string) error
- func SetHttpHealthyClose(url string, checkType string) error
- func SetHttpHealthyOpen(url string, checkType string) error
- type Checker
- type GrpcHealthyServer
- func (h *GrpcHealthyServer) HealthLiveness(context.Context, *pb.HealthyRequest) (*pb.HealthyResponse, error)
- func (h *GrpcHealthyServer) HealthLivenessSet(ctx context.Context, req *pb.HealthyStatus) (*pb.HealthyResponse, error)
- func (h *GrpcHealthyServer) HealthReadiness(context.Context, *pb.HealthyRequest) (*pb.HealthyResponse, error)
- func (h *GrpcHealthyServer) HealthReadinessSet(ctx context.Context, req *pb.HealthyStatus) (*pb.HealthyResponse, error)
- func (h *GrpcHealthyServer) HealthStartup(context.Context, *pb.HealthyRequest) (*pb.HealthyResponse, error)
- func (h *GrpcHealthyServer) HealthStartupSet(ctx context.Context, req *pb.HealthyStatus) (*pb.HealthyResponse, error)
- type Health
Constants ¶
View Source
const ( HealthGroupPath = "/healthx" HealthLivenessPath = "/liveness" HealthReadinessPath = "/readiness" HealthStartupPath = "/startup" HealthLiveness = "liveness" HealthReadiness = "readiness" HealthStartup = "startup" CheckInterval = time.Second * 5 CheckIntervalTimeOut = CheckInterval * 3 HealthStatus = "HEALTH_STATUS" StatusOpen = "open" StatusClose = "close" )
Variables ¶
View Source
var (
HealthyFile = filepath.Join(os.TempDir(), "dio.healthy")
)
Functions ¶
func CheckCtlHealthyStat ¶
func CheckGrpcHealthy ¶
func CheckHttpHealthyStat ¶
func CheckerFuncRun ¶
func RegLivenessCheckers ¶
func RegLivenessCheckers(checkers ...Checker)
func RegReadinessCheckers ¶
func RegReadinessCheckers(checkers ...Checker)
func RegStartupCheckers ¶
func RegStartupCheckers(checkers ...Checker)
func SetGrpcHealthyClose ¶
func SetGrpcHealthyOpen ¶
func SetHttpHealthyClose ¶
func SetHttpHealthyOpen ¶
Types ¶
type GrpcHealthyServer ¶
type GrpcHealthyServer struct {
// contains filtered or unexported fields
}
func GetGrpcHealthyServer ¶
func GetGrpcHealthyServer() *GrpcHealthyServer
func (*GrpcHealthyServer) HealthLiveness ¶
func (h *GrpcHealthyServer) HealthLiveness(context.Context, *pb.HealthyRequest) (*pb.HealthyResponse, error)
func (*GrpcHealthyServer) HealthLivenessSet ¶
func (h *GrpcHealthyServer) HealthLivenessSet(ctx context.Context, req *pb.HealthyStatus) (*pb.HealthyResponse, error)
func (*GrpcHealthyServer) HealthReadiness ¶
func (h *GrpcHealthyServer) HealthReadiness(context.Context, *pb.HealthyRequest) (*pb.HealthyResponse, error)
func (*GrpcHealthyServer) HealthReadinessSet ¶
func (h *GrpcHealthyServer) HealthReadinessSet(ctx context.Context, req *pb.HealthyStatus) (*pb.HealthyResponse, error)
func (*GrpcHealthyServer) HealthStartup ¶
func (h *GrpcHealthyServer) HealthStartup(context.Context, *pb.HealthyRequest) (*pb.HealthyResponse, error)
func (*GrpcHealthyServer) HealthStartupSet ¶
func (h *GrpcHealthyServer) HealthStartupSet(ctx context.Context, req *pb.HealthyStatus) (*pb.HealthyResponse, error)
Click to show internal directories.
Click to hide internal directories.