-
Notifications
You must be signed in to change notification settings - Fork 44
/
achievement_http.pb.go
76 lines (64 loc) · 2.3 KB
/
achievement_http.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Code generated by protoc-gen-go-http. DO NOT EDIT.
// versions:
// - protoc-gen-go-http v2.5.3
// - protoc v3.20.0
// source: achievement/service/v1/achievement.proto
package v1
import (
context "context"
http "github.com/go-kratos/kratos/v2/transport/http"
binding "github.com/go-kratos/kratos/v2/transport/http/binding"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the kratos package it is being compiled against.
var _ = new(context.Context)
var _ = binding.EncodeURL
const _ = http.SupportPackageIsVersion1
const OperationAchievementGetHealth = "/achievement.v1.Achievement/GetHealth"
type AchievementHTTPServer interface {
GetHealth(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
}
func RegisterAchievementHTTPServer(s *http.Server, srv AchievementHTTPServer) {
r := s.Route("/")
r.GET("/v1/get/health", _Achievement_GetHealth0_HTTP_Handler(srv))
}
func _Achievement_GetHealth0_HTTP_Handler(srv AchievementHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in emptypb.Empty
if err := ctx.BindQuery(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationAchievementGetHealth)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetHealth(ctx, req.(*emptypb.Empty))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*emptypb.Empty)
return ctx.Result(200, reply)
}
}
type AchievementHTTPClient interface {
GetHealth(ctx context.Context, req *emptypb.Empty, opts ...http.CallOption) (rsp *emptypb.Empty, err error)
}
type AchievementHTTPClientImpl struct {
cc *http.Client
}
func NewAchievementHTTPClient(client *http.Client) AchievementHTTPClient {
return &AchievementHTTPClientImpl{client}
}
func (c *AchievementHTTPClientImpl) GetHealth(ctx context.Context, in *emptypb.Empty, opts ...http.CallOption) (*emptypb.Empty, error) {
var out emptypb.Empty
pattern := "/v1/get/health"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationAchievementGetHealth))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}