代码拉取完成,页面将自动刷新
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: api1.proto
package api1
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
proto1 "github.com/micro/go-micro/api/proto"
context "context"
client "github.com/micro/go-micro/v2/client"
server "github.com/micro/go-micro/v2/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for Api1 service
type Api1Service interface {
Get(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error)
Post(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error)
}
type api1Service struct {
c client.Client
name string
}
func NewApi1Service(name string, c client.Client) Api1Service {
return &api1Service{
c: c,
name: name,
}
}
func (c *api1Service) Get(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error) {
req := c.c.NewRequest(c.name, "Api1.Get", in)
out := new(proto1.Response)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *api1Service) Post(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.Response, error) {
req := c.c.NewRequest(c.name, "Api1.Post", in)
out := new(proto1.Response)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Api1 service
type Api1Handler interface {
Get(context.Context, *proto1.Request, *proto1.Response) error
Post(context.Context, *proto1.Request, *proto1.Response) error
}
func RegisterApi1Handler(s server.Server, hdlr Api1Handler, opts ...server.HandlerOption) error {
type api1 interface {
Get(ctx context.Context, in *proto1.Request, out *proto1.Response) error
Post(ctx context.Context, in *proto1.Request, out *proto1.Response) error
}
type Api1 struct {
api1
}
h := &api1Handler{hdlr}
return s.Handle(s.NewHandler(&Api1{h}, opts...))
}
type api1Handler struct {
Api1Handler
}
func (h *api1Handler) Get(ctx context.Context, in *proto1.Request, out *proto1.Response) error {
return h.Api1Handler.Get(ctx, in, out)
}
func (h *api1Handler) Post(ctx context.Context, in *proto1.Request, out *proto1.Response) error {
return h.Api1Handler.Post(ctx, in, out)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。