You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kratos/cmd/protoc-gen-go-http/internal/testproto/echo_service_http.pb.go

216 lines
4.9 KiB

4 years ago
// Code generated by protoc-gen-go-http. DO NOT EDIT.
package testproto
import (
context "context"
http1 "github.com/go-kratos/kratos/v2/transport/http"
http "net/http"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the kratos package it is being compiled against.
// context./http.
4 years ago
const _ = http1.SupportPackageIsVersion1
type EchoServiceHTTPServer interface {
Echo(context.Context, *SimpleMessage) (*SimpleMessage, error)
EchoBody(context.Context, *SimpleMessage) (*SimpleMessage, error)
EchoDelete(context.Context, *SimpleMessage) (*SimpleMessage, error)
EchoPatch(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error)
}
func RegisterEchoServiceHTTPServer(s http1.ServiceRegistrar, srv EchoServiceHTTPServer) {
s.RegisterService(&_HTTP_EchoService_serviceDesc, srv)
}
func _HTTP_EchoService_Echo_0(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in SimpleMessage
if err := http1.BindVars(req, &in); err != nil {
return nil, err
}
if err := http1.BindForm(req, &in); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).Echo(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
func _HTTP_EchoService_Echo_1(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in SimpleMessage
if err := http1.BindVars(req, &in); err != nil {
return nil, err
}
if err := http1.BindForm(req, &in); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).Echo(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
func _HTTP_EchoService_Echo_2(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in SimpleMessage
if err := http1.BindVars(req, &in); err != nil {
return nil, err
}
if err := http1.BindForm(req, &in); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).Echo(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
func _HTTP_EchoService_Echo_3(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in SimpleMessage
if err := http1.BindVars(req, &in); err != nil {
return nil, err
}
if err := http1.BindForm(req, &in); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).Echo(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
func _HTTP_EchoService_Echo_4(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in SimpleMessage
if err := http1.BindVars(req, &in); err != nil {
return nil, err
}
if err := http1.BindForm(req, &in); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).Echo(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
func _HTTP_EchoService_EchoBody_0(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in SimpleMessage
if err := dec(&in); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).EchoBody(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
func _HTTP_EchoService_EchoDelete_0(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in SimpleMessage
if err := http1.BindForm(req, &in); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).EchoDelete(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
func _HTTP_EchoService_EchoPatch_0(srv interface{}, ctx context.Context, req *http.Request, dec func(interface{}) error) (interface{}, error) {
4 years ago
var in DynamicMessageUpdate
if err := dec(in.Body); err != nil {
return nil, err
}
out, err := srv.(EchoServiceServer).EchoPatch(ctx, &in)
4 years ago
if err != nil {
return nil, err
}
return out, nil
}
var _HTTP_EchoService_serviceDesc = http1.ServiceDesc{
ServiceName: "testproto.EchoService",
Methods: []http1.MethodDesc{
{
Path: "/v1/example/echo/{id}/{num}",
Method: "GET",
Handler: _HTTP_EchoService_Echo_0,
},
{
Path: "/v1/example/echo/{id}/{num}/{lang}",
Method: "GET",
Handler: _HTTP_EchoService_Echo_1,
},
{
Path: "/v1/example/echo1/{id}/{line_num}/{status.note}",
Method: "GET",
Handler: _HTTP_EchoService_Echo_2,
},
{
Path: "/v1/example/echo2/{no.note}",
Method: "GET",
Handler: _HTTP_EchoService_Echo_3,
},
{
Path: "/v1/example/echo/{id}",
Method: "POST",
Handler: _HTTP_EchoService_Echo_4,
},
{
Path: "/v1/example/echo_body",
Method: "POST",
Handler: _HTTP_EchoService_EchoBody_0,
},
{
Path: "/v1/example/echo_delete",
Method: "DELETE",
Handler: _HTTP_EchoService_EchoDelete_0,
},
{
Path: "/v1/example/echo_patch",
Method: "PATCH",
Handler: _HTTP_EchoService_EchoPatch_0,
},
},
Metadata: "echo_service.proto",
}