2023-02-26 14:51:34 +03:00
|
|
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
2024-04-10 00:15:54 +03:00
|
|
|
// protoc-gen-go-micro version: v3.10.4
|
|
|
|
// source: health/health.proto
|
2023-02-26 14:51:34 +03:00
|
|
|
|
2024-04-10 00:15:54 +03:00
|
|
|
package health_handler
|
2023-02-26 14:51:34 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2024-04-10 00:15:54 +03:00
|
|
|
v31 "go.unistack.org/micro-client-http/v3"
|
2023-02-26 14:51:34 +03:00
|
|
|
codec "go.unistack.org/micro-proto/v3/codec"
|
|
|
|
v3 "go.unistack.org/micro-server-http/v3"
|
2024-04-10 00:15:54 +03:00
|
|
|
client "go.unistack.org/micro/v3/client"
|
2023-02-26 14:51:34 +03:00
|
|
|
server "go.unistack.org/micro/v3/server"
|
2024-04-10 00:15:54 +03:00
|
|
|
http "net/http"
|
2023-02-26 14:51:34 +03:00
|
|
|
)
|
|
|
|
|
2024-04-10 00:15:54 +03:00
|
|
|
var (
|
|
|
|
HealthServiceServerEndpoints = []v3.EndpointMetadata{
|
2024-12-02 15:47:30 +03:00
|
|
|
{
|
|
|
|
Name: "HealthService.Healthy",
|
|
|
|
Path: "/health",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "HealthService.Healthy",
|
|
|
|
Path: "/healthz",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
2024-04-10 00:15:54 +03:00
|
|
|
{
|
|
|
|
Name: "HealthService.Live",
|
|
|
|
Path: "/live",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
2024-12-02 15:47:30 +03:00
|
|
|
{
|
|
|
|
Name: "HealthService.Live",
|
|
|
|
Path: "/livez",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
2024-04-10 00:15:54 +03:00
|
|
|
{
|
|
|
|
Name: "HealthService.Ready",
|
|
|
|
Path: "/ready",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
2024-12-02 15:47:30 +03:00
|
|
|
{
|
|
|
|
Name: "HealthService.Ready",
|
|
|
|
Path: "/readyz",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
2024-04-10 00:15:54 +03:00
|
|
|
{
|
|
|
|
Name: "HealthService.Version",
|
|
|
|
Path: "/version",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
type healthServiceClient struct {
|
|
|
|
c client.Client
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewHealthServiceClient(name string, c client.Client) HealthServiceClient {
|
|
|
|
return &healthServiceClient{c: c, name: name}
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:47:30 +03:00
|
|
|
func (c *healthServiceClient) Healthy(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error) {
|
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &codec.Frame{}
|
|
|
|
opts = append(opts,
|
|
|
|
v31.ErrorMap(errmap),
|
|
|
|
)
|
|
|
|
opts = append(opts,
|
|
|
|
v31.Method(http.MethodGet),
|
|
|
|
v31.Path("/health"),
|
|
|
|
)
|
|
|
|
rsp := &codec.Frame{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "HealthService.Healthy", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2024-04-10 00:15:54 +03:00
|
|
|
func (c *healthServiceClient) Live(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error) {
|
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &codec.Frame{}
|
|
|
|
opts = append(opts,
|
|
|
|
v31.ErrorMap(errmap),
|
|
|
|
)
|
|
|
|
opts = append(opts,
|
|
|
|
v31.Method(http.MethodGet),
|
|
|
|
v31.Path("/live"),
|
|
|
|
)
|
|
|
|
rsp := &codec.Frame{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "HealthService.Live", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *healthServiceClient) Ready(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error) {
|
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &codec.Frame{}
|
|
|
|
opts = append(opts,
|
|
|
|
v31.ErrorMap(errmap),
|
|
|
|
)
|
|
|
|
opts = append(opts,
|
|
|
|
v31.Method(http.MethodGet),
|
|
|
|
v31.Path("/ready"),
|
|
|
|
)
|
|
|
|
rsp := &codec.Frame{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "HealthService.Ready", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *healthServiceClient) Version(ctx context.Context, req *codec.Frame, opts ...client.CallOption) (*codec.Frame, error) {
|
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &codec.Frame{}
|
|
|
|
opts = append(opts,
|
|
|
|
v31.ErrorMap(errmap),
|
|
|
|
)
|
|
|
|
opts = append(opts,
|
|
|
|
v31.Method(http.MethodGet),
|
|
|
|
v31.Path("/version"),
|
|
|
|
)
|
|
|
|
rsp := &codec.Frame{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "HealthService.Version", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-02-26 14:51:34 +03:00
|
|
|
type healthServiceServer struct {
|
|
|
|
HealthServiceServer
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:47:30 +03:00
|
|
|
func (h *healthServiceServer) Healthy(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error {
|
|
|
|
return h.HealthServiceServer.Healthy(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
2023-02-26 14:51:34 +03:00
|
|
|
func (h *healthServiceServer) Live(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error {
|
|
|
|
return h.HealthServiceServer.Live(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *healthServiceServer) Ready(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error {
|
|
|
|
return h.HealthServiceServer.Ready(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *healthServiceServer) Version(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error {
|
|
|
|
return h.HealthServiceServer.Version(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterHealthServiceServer(s server.Server, sh HealthServiceServer, opts ...server.HandlerOption) error {
|
|
|
|
type healthService interface {
|
2024-12-02 15:47:30 +03:00
|
|
|
Healthy(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
|
2023-02-26 14:51:34 +03:00
|
|
|
Live(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
|
|
|
|
Ready(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
|
|
|
|
Version(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
|
|
|
|
}
|
|
|
|
type HealthService struct {
|
|
|
|
healthService
|
|
|
|
}
|
|
|
|
h := &healthServiceServer{sh}
|
|
|
|
var nopts []server.HandlerOption
|
|
|
|
nopts = append(nopts, v3.HandlerEndpoints(HealthServiceServerEndpoints))
|
|
|
|
return s.Handle(s.NewHandler(&HealthService{h}, append(nopts, opts...)...))
|
|
|
|
}
|