|
@@ -25,6 +25,14 @@ func Connect(url string) (*Bus, error) {
|
|
|
return &Bus{NATS: encodedConn}, nil
|
|
|
}
|
|
|
|
|
|
+func (bus *Bus) Close() {
|
|
|
+ bus.NATS.Close()
|
|
|
+}
|
|
|
+
|
|
|
+func (bus *Bus) Drain() error {
|
|
|
+ return bus.NATS.Drain()
|
|
|
+}
|
|
|
+
|
|
|
func (bus *Bus) SendEmail(request *SendEmail) error {
|
|
|
return bus.Publish("email.outbound", request)
|
|
|
}
|