233 lines
8.8 KiB
Go
233 lines
8.8 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.4.0
|
|
// - protoc v3.19.4
|
|
// source: generate/protobuf/notification.proto
|
|
|
|
package notification
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.62.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion8
|
|
|
|
const (
|
|
SenderService_SendMail_FullMethodName = "/notification.SenderService/SendMail"
|
|
SenderService_SendSms_FullMethodName = "/notification.SenderService/SendSms"
|
|
SenderService_SendMailByTemplateId_FullMethodName = "/notification.SenderService/SendMailByTemplateId"
|
|
SenderService_SendSmsByTemplateId_FullMethodName = "/notification.SenderService/SendSmsByTemplateId"
|
|
)
|
|
|
|
// SenderServiceClient is the client API for SenderService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
type SenderServiceClient interface {
|
|
// SendMail 寄信
|
|
SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
// SendSms 寄簡訊
|
|
SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
// SendMailByTemplateId 寄送模板信件
|
|
SendMailByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
// SendSmsByTemplateId 寄送模板簡訊
|
|
SendSmsByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error)
|
|
}
|
|
|
|
type senderServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewSenderServiceClient(cc grpc.ClientConnInterface) SenderServiceClient {
|
|
return &senderServiceClient{cc}
|
|
}
|
|
|
|
func (c *senderServiceClient) SendMail(ctx context.Context, in *SendMailReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(OKResp)
|
|
err := c.cc.Invoke(ctx, SenderService_SendMail_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *senderServiceClient) SendSms(ctx context.Context, in *SendSMSReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(OKResp)
|
|
err := c.cc.Invoke(ctx, SenderService_SendSms_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *senderServiceClient) SendMailByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(OKResp)
|
|
err := c.cc.Invoke(ctx, SenderService_SendMailByTemplateId_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *senderServiceClient) SendSmsByTemplateId(ctx context.Context, in *SendByTemplateIDReq, opts ...grpc.CallOption) (*OKResp, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(OKResp)
|
|
err := c.cc.Invoke(ctx, SenderService_SendSmsByTemplateId_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// SenderServiceServer is the server API for SenderService service.
|
|
// All implementations must embed UnimplementedSenderServiceServer
|
|
// for forward compatibility
|
|
type SenderServiceServer interface {
|
|
// SendMail 寄信
|
|
SendMail(context.Context, *SendMailReq) (*OKResp, error)
|
|
// SendSms 寄簡訊
|
|
SendSms(context.Context, *SendSMSReq) (*OKResp, error)
|
|
// SendMailByTemplateId 寄送模板信件
|
|
SendMailByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error)
|
|
// SendSmsByTemplateId 寄送模板簡訊
|
|
SendSmsByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error)
|
|
mustEmbedUnimplementedSenderServiceServer()
|
|
}
|
|
|
|
// UnimplementedSenderServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedSenderServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedSenderServiceServer) SendMail(context.Context, *SendMailReq) (*OKResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SendMail not implemented")
|
|
}
|
|
func (UnimplementedSenderServiceServer) SendSms(context.Context, *SendSMSReq) (*OKResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SendSms not implemented")
|
|
}
|
|
func (UnimplementedSenderServiceServer) SendMailByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SendMailByTemplateId not implemented")
|
|
}
|
|
func (UnimplementedSenderServiceServer) SendSmsByTemplateId(context.Context, *SendByTemplateIDReq) (*OKResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SendSmsByTemplateId not implemented")
|
|
}
|
|
func (UnimplementedSenderServiceServer) mustEmbedUnimplementedSenderServiceServer() {}
|
|
|
|
// UnsafeSenderServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to SenderServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeSenderServiceServer interface {
|
|
mustEmbedUnimplementedSenderServiceServer()
|
|
}
|
|
|
|
func RegisterSenderServiceServer(s grpc.ServiceRegistrar, srv SenderServiceServer) {
|
|
s.RegisterService(&SenderService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _SenderService_SendMail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SendMailReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SenderServiceServer).SendMail(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SenderService_SendMail_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SenderServiceServer).SendMail(ctx, req.(*SendMailReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SenderService_SendSms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SendSMSReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SenderServiceServer).SendSms(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SenderService_SendSms_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SenderServiceServer).SendSms(ctx, req.(*SendSMSReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SenderService_SendMailByTemplateId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SendByTemplateIDReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SenderServiceServer).SendMailByTemplateId(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SenderService_SendMailByTemplateId_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SenderServiceServer).SendMailByTemplateId(ctx, req.(*SendByTemplateIDReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _SenderService_SendSmsByTemplateId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SendByTemplateIDReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SenderServiceServer).SendSmsByTemplateId(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: SenderService_SendSmsByTemplateId_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SenderServiceServer).SendSmsByTemplateId(ctx, req.(*SendByTemplateIDReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// SenderService_ServiceDesc is the grpc.ServiceDesc for SenderService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var SenderService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "notification.SenderService",
|
|
HandlerType: (*SenderServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "SendMail",
|
|
Handler: _SenderService_SendMail_Handler,
|
|
},
|
|
{
|
|
MethodName: "SendSms",
|
|
Handler: _SenderService_SendSms_Handler,
|
|
},
|
|
{
|
|
MethodName: "SendMailByTemplateId",
|
|
Handler: _SenderService_SendMailByTemplateId_Handler,
|
|
},
|
|
{
|
|
MethodName: "SendSmsByTemplateId",
|
|
Handler: _SenderService_SendSmsByTemplateId_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "generate/protobuf/notification.proto",
|
|
}
|