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

241 lines
6.0 KiB

4 years ago
// Code generated by protoc-gen-go-http. DO NOT EDIT.
package testproto
import (
context "context"
middleware "github.com/go-kratos/kratos/v2/middleware"
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./middleware.
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, m middleware.Middleware) (interface{}, error) {
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
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).Echo(ctx, &in)
}
out, err := m(h)(ctx, &in)
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, m middleware.Middleware) (interface{}, error) {
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
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).Echo(ctx, &in)
}
out, err := m(h)(ctx, &in)
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, m middleware.Middleware) (interface{}, error) {
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
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).Echo(ctx, &in)
}
out, err := m(h)(ctx, &in)
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, m middleware.Middleware) (interface{}, error) {
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
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).Echo(ctx, &in)
}
out, err := m(h)(ctx, &in)
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, m middleware.Middleware) (interface{}, error) {
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
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).Echo(ctx, &in)
}
out, err := m(h)(ctx, &in)
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, m middleware.Middleware) (interface{}, error) {
var in SimpleMessage
if err := dec(&in); err != nil {
return nil, err
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).EchoBody(ctx, &in)
}
out, err := m(h)(ctx, &in)
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, m middleware.Middleware) (interface{}, error) {
var in SimpleMessage
if err := http1.BindForm(req, &in); err != nil {
return nil, err
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).EchoDelete(ctx, &in)
}
out, err := m(h)(ctx, &in)
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, m middleware.Middleware) (interface{}, error) {
var in DynamicMessageUpdate
if err := dec(in.Body); err != nil {
return nil, err
}
h := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EchoServiceServer).EchoPatch(ctx, &in)
}
out, err := m(h)(ctx, &in)
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",
}