This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploymentruntime_http.pb.go
executable file
·198 lines (180 loc) · 7.6 KB
/
deploymentruntime_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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Code generated by protoc-gen-go-http. DO NOT EDIT.
// versions:
// - protoc-gen-go-http v2.6.3
// - protoc v3.12.4
// source: deploymentruntime/v1/deploymentruntime.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"
)
// 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 OperationDeploymentruntimeDeleteDeploymentRuntime = "/api.deploymentruntime.v1.Deploymentruntime/DeleteDeploymentRuntime"
const OperationDeploymentruntimeGetDeploymentRuntime = "/api.deploymentruntime.v1.Deploymentruntime/GetDeploymentRuntime"
const OperationDeploymentruntimeListDeploymentRuntimes = "/api.deploymentruntime.v1.Deploymentruntime/ListDeploymentRuntimes"
const OperationDeploymentruntimeSaveDeploymentRuntime = "/api.deploymentruntime.v1.Deploymentruntime/SaveDeploymentRuntime"
type DeploymentruntimeHTTPServer interface {
DeleteDeploymentRuntime(context.Context, *DeleteRequest) (*DeleteReply, error)
GetDeploymentRuntime(context.Context, *GetRequest) (*GetReply, error)
ListDeploymentRuntimes(context.Context, *ListsRequest) (*ListsReply, error)
SaveDeploymentRuntime(context.Context, *SaveRequest) (*SaveReply, error)
}
func RegisterDeploymentruntimeHTTPServer(s *http.Server, srv DeploymentruntimeHTTPServer) {
r := s.Route("/")
r.GET("/api/v1/products/{productName}/deploymentruntimes/{deploymentruntimeName}", _Deploymentruntime_GetDeploymentRuntime0_HTTP_Handler(srv))
r.GET("/api/v1/products/{productName}/deploymentruntimes", _Deploymentruntime_ListDeploymentRuntimes0_HTTP_Handler(srv))
r.POST("/api/v1/products/{productName}/deploymentruntimes/{deploymentruntimeName}", _Deploymentruntime_SaveDeploymentRuntime0_HTTP_Handler(srv))
r.DELETE("/api/v1/products/{productName}/deploymentruntimes/{deploymentruntimeName}", _Deploymentruntime_DeleteDeploymentRuntime0_HTTP_Handler(srv))
}
func _Deploymentruntime_GetDeploymentRuntime0_HTTP_Handler(srv DeploymentruntimeHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in GetRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
if err := ctx.BindVars(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationDeploymentruntimeGetDeploymentRuntime)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.GetDeploymentRuntime(ctx, req.(*GetRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*GetReply)
return ctx.Result(200, reply)
}
}
func _Deploymentruntime_ListDeploymentRuntimes0_HTTP_Handler(srv DeploymentruntimeHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in ListsRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
if err := ctx.BindVars(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationDeploymentruntimeListDeploymentRuntimes)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.ListDeploymentRuntimes(ctx, req.(*ListsRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*ListsReply)
return ctx.Result(200, reply)
}
}
func _Deploymentruntime_SaveDeploymentRuntime0_HTTP_Handler(srv DeploymentruntimeHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in SaveRequest
if err := ctx.Bind(&in.Body); err != nil {
return err
}
if err := ctx.BindQuery(&in); err != nil {
return err
}
if err := ctx.BindVars(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationDeploymentruntimeSaveDeploymentRuntime)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.SaveDeploymentRuntime(ctx, req.(*SaveRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*SaveReply)
return ctx.Result(200, reply)
}
}
func _Deploymentruntime_DeleteDeploymentRuntime0_HTTP_Handler(srv DeploymentruntimeHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in DeleteRequest
if err := ctx.BindQuery(&in); err != nil {
return err
}
if err := ctx.BindVars(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationDeploymentruntimeDeleteDeploymentRuntime)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.DeleteDeploymentRuntime(ctx, req.(*DeleteRequest))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*DeleteReply)
return ctx.Result(200, reply)
}
}
type DeploymentruntimeHTTPClient interface {
DeleteDeploymentRuntime(ctx context.Context, req *DeleteRequest, opts ...http.CallOption) (rsp *DeleteReply, err error)
GetDeploymentRuntime(ctx context.Context, req *GetRequest, opts ...http.CallOption) (rsp *GetReply, err error)
ListDeploymentRuntimes(ctx context.Context, req *ListsRequest, opts ...http.CallOption) (rsp *ListsReply, err error)
SaveDeploymentRuntime(ctx context.Context, req *SaveRequest, opts ...http.CallOption) (rsp *SaveReply, err error)
}
type DeploymentruntimeHTTPClientImpl struct {
cc *http.Client
}
func NewDeploymentruntimeHTTPClient(client *http.Client) DeploymentruntimeHTTPClient {
return &DeploymentruntimeHTTPClientImpl{client}
}
func (c *DeploymentruntimeHTTPClientImpl) DeleteDeploymentRuntime(ctx context.Context, in *DeleteRequest, opts ...http.CallOption) (*DeleteReply, error) {
var out DeleteReply
pattern := "/api/v1/products/{productName}/deploymentruntimes/{deploymentruntimeName}"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationDeploymentruntimeDeleteDeploymentRuntime))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "DELETE", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *DeploymentruntimeHTTPClientImpl) GetDeploymentRuntime(ctx context.Context, in *GetRequest, opts ...http.CallOption) (*GetReply, error) {
var out GetReply
pattern := "/api/v1/products/{productName}/deploymentruntimes/{deploymentruntimeName}"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationDeploymentruntimeGetDeploymentRuntime))
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
}
func (c *DeploymentruntimeHTTPClientImpl) ListDeploymentRuntimes(ctx context.Context, in *ListsRequest, opts ...http.CallOption) (*ListsReply, error) {
var out ListsReply
pattern := "/api/v1/products/{productName}/deploymentruntimes"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationDeploymentruntimeListDeploymentRuntimes))
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
}
func (c *DeploymentruntimeHTTPClientImpl) SaveDeploymentRuntime(ctx context.Context, in *SaveRequest, opts ...http.CallOption) (*SaveReply, error) {
var out SaveReply
pattern := "/api/v1/products/{productName}/deploymentruntimes/{deploymentruntimeName}"
path := binding.EncodeURL(pattern, in, false)
opts = append(opts, http.Operation(OperationDeploymentruntimeSaveDeploymentRuntime))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "POST", path, in.Body, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}