/
smtp.pb.go
182 lines (152 loc) · 7.5 KB
/
smtp.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// Code generated by protoc-gen-go.
// source: github.com/Rakanixu/smtp/srv/proto/smtp/smtp.proto
// DO NOT EDIT!
/*
Package go_micro_srv_smtp is a generated protocol buffer package.
It is generated from these files:
github.com/Rakanixu/smtp/srv/proto/smtp/smtp.proto
It has these top-level messages:
SendRequest
SendResponse
SetSettingsRequest
SetSettingsResponse
*/
package go_micro_srv_smtp
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
client "github.com/micro/go-micro/client"
server "github.com/micro/go-micro/server"
context "golang.org/x/net/context"
)
// 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.
const _ = proto.ProtoPackageIsVersion1
type SendRequest struct {
Recipient []string `protobuf:"bytes,1,rep,name=recipient" json:"recipient,omitempty"`
Subject string `protobuf:"bytes,2,opt,name=subject" json:"subject,omitempty"`
Body string `protobuf:"bytes,3,opt,name=body" json:"body,omitempty"`
}
func (m *SendRequest) Reset() { *m = SendRequest{} }
func (m *SendRequest) String() string { return proto.CompactTextString(m) }
func (*SendRequest) ProtoMessage() {}
func (*SendRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type SendResponse struct {
}
func (m *SendResponse) Reset() { *m = SendResponse{} }
func (m *SendResponse) String() string { return proto.CompactTextString(m) }
func (*SendResponse) ProtoMessage() {}
func (*SendResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type SetSettingsRequest struct {
EmailHost string `protobuf:"bytes,1,opt,name=email_host,json=emailHost" json:"email_host,omitempty"`
EmailHostPort string `protobuf:"bytes,2,opt,name=email_host_port,json=emailHostPort" json:"email_host_port,omitempty"`
EmailHostUser string `protobuf:"bytes,3,opt,name=email_host_user,json=emailHostUser" json:"email_host_user,omitempty"`
EmailHostPassword string `protobuf:"bytes,4,opt,name=email_host_password,json=emailHostPassword" json:"email_host_password,omitempty"`
DefaultFromEmail string `protobuf:"bytes,5,opt,name=default_from_email,json=defaultFromEmail" json:"default_from_email,omitempty"`
}
func (m *SetSettingsRequest) Reset() { *m = SetSettingsRequest{} }
func (m *SetSettingsRequest) String() string { return proto.CompactTextString(m) }
func (*SetSettingsRequest) ProtoMessage() {}
func (*SetSettingsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
type SetSettingsResponse struct {
}
func (m *SetSettingsResponse) Reset() { *m = SetSettingsResponse{} }
func (m *SetSettingsResponse) String() string { return proto.CompactTextString(m) }
func (*SetSettingsResponse) ProtoMessage() {}
func (*SetSettingsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func init() {
proto.RegisterType((*SendRequest)(nil), "go.micro.srv.smtp.SendRequest")
proto.RegisterType((*SendResponse)(nil), "go.micro.srv.smtp.SendResponse")
proto.RegisterType((*SetSettingsRequest)(nil), "go.micro.srv.smtp.SetSettingsRequest")
proto.RegisterType((*SetSettingsResponse)(nil), "go.micro.srv.smtp.SetSettingsResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for SMTP service
type SMTPClient interface {
Send(ctx context.Context, in *SendRequest, opts ...client.CallOption) (*SendResponse, error)
SetSettings(ctx context.Context, in *SetSettingsRequest, opts ...client.CallOption) (*SetSettingsResponse, error)
}
type sMTPClient struct {
c client.Client
serviceName string
}
func NewSMTPClient(serviceName string, c client.Client) SMTPClient {
if c == nil {
c = client.NewClient()
}
if len(serviceName) == 0 {
serviceName = "go.micro.srv.smtp"
}
return &sMTPClient{
c: c,
serviceName: serviceName,
}
}
func (c *sMTPClient) Send(ctx context.Context, in *SendRequest, opts ...client.CallOption) (*SendResponse, error) {
req := c.c.NewRequest(c.serviceName, "SMTP.Send", in)
out := new(SendResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sMTPClient) SetSettings(ctx context.Context, in *SetSettingsRequest, opts ...client.CallOption) (*SetSettingsResponse, error) {
req := c.c.NewRequest(c.serviceName, "SMTP.SetSettings", in)
out := new(SetSettingsResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for SMTP service
type SMTPHandler interface {
Send(context.Context, *SendRequest, *SendResponse) error
SetSettings(context.Context, *SetSettingsRequest, *SetSettingsResponse) error
}
func RegisterSMTPHandler(s server.Server, hdlr SMTPHandler) {
s.Handle(s.NewHandler(&SMTP{hdlr}))
}
type SMTP struct {
SMTPHandler
}
func (h *SMTP) Send(ctx context.Context, in *SendRequest, out *SendResponse) error {
return h.SMTPHandler.Send(ctx, in, out)
}
func (h *SMTP) SetSettings(ctx context.Context, in *SetSettingsRequest, out *SetSettingsResponse) error {
return h.SMTPHandler.SetSettings(ctx, in, out)
}
var fileDescriptor0 = []byte{
// 340 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x52, 0xdb, 0x4a, 0xc3, 0x40,
0x10, 0x35, 0xb6, 0x2a, 0x1d, 0xaf, 0x9d, 0x22, 0x84, 0xe2, 0xa5, 0x04, 0x2c, 0x3e, 0xc8, 0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