cms-template-proto/micro/cms_template_service_micro_grpc.pb.go

51 lines
1.6 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-go-micro. DO NOT EDIT.
// protoc-gen-go-micro version: v3.10.4
// source: cms_template_service.proto
package cms_template_proto
import (
context "context"
cms_template_proto "go.unistack.org/cms-template-proto"
client "go.unistack.org/micro/v3/client"
server "go.unistack.org/micro/v3/server"
)
type templateServiceClient struct {
c client.Client
name string
}
func NewTemplateServiceClient(name string, c client.Client) cms_template_proto.TemplateServiceClient {
return &templateServiceClient{c: c, name: name}
}
func (c *templateServiceClient) Call(ctx context.Context, req *cms_template_proto.CallReq, opts ...client.CallOption) (*cms_template_proto.CallRsp, error) {
rsp := &cms_template_proto.CallRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TemplateService.Call", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
type templateServiceServer struct {
cms_template_proto.TemplateServiceServer
}
func (h *templateServiceServer) Call(ctx context.Context, req *cms_template_proto.CallReq, rsp *cms_template_proto.CallRsp) error {
return h.TemplateServiceServer.Call(ctx, req, rsp)
}
func RegisterTemplateServiceServer(s server.Server, sh cms_template_proto.TemplateServiceServer, opts ...server.HandlerOption) error {
type templateService interface {
Call(ctx context.Context, req *cms_template_proto.CallReq, rsp *cms_template_proto.CallRsp) error
}
type TemplateService struct {
templateService
}
h := &templateServiceServer{sh}
var nopts []server.HandlerOption
return s.Handle(s.NewHandler(&TemplateService{h}, append(nopts, opts...)...))
}