Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HealthCmd = &cobra.Command{
Use: "health",
Short: "Health is a grpc client to health check remote grpc server",
Long: `Health is a grpc client to invoke livess and readiness functions of remote grpc server`,
}
View Source
var LivenessCmd = &cobra.Command{ Use: "liveness", Short: "liveness checks the liveness of remote grpc server", Long: `liveness checks the liveness of remote grpc server`, SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { grpcAddr := fmt.Sprintf("%s:%d", host, port) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() conn, err := grpc.DialContext(ctx, grpcAddr, grpc.WithInsecure(), grpc.WithBlock(), ) if err != nil { return err } defer conn.Close() c := health.NewHealthCheckServiceClient(conn) _, err = c.Liveness(context.Background(), nil) return err }, }
LivenessCmd represents the liveness command
View Source
var ReadinessCmd = &cobra.Command{ Use: "readiness", Short: "readiness checks the readiness of remote grpc server", Long: `readiness checks the readiness of remote grpc server`, SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { grpcAddr := fmt.Sprintf("%s:%d", host, port) ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() conn, err := grpc.DialContext(ctx, grpcAddr, grpc.WithInsecure(), grpc.WithBlock(), ) if err != nil { return err } defer conn.Close() c := health.NewHealthCheckServiceClient(conn) _, err = c.Readiness(ctx, nil) return err }, }
ReadinessCmd represents the readiness command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.