|
@@ -21,3 +21,43 @@ func Connect(url string) (*Bus, error) {
|
|
}
|
|
}
|
|
return &Bus{NATS: encodedConn}, nil
|
|
return &Bus{NATS: encodedConn}, nil
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func (bus *Bus) SendEmail(request *SendEmail) error {
|
|
|
|
+ envelope := request // TODO
|
|
|
|
+ if err := bus.NATS.Publish("email.outbound", envelope); err != nil {
|
|
|
|
+ return fmt.Errorf("failed to enqueue outbound email: %w", err)
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (bus *Bus) RegisterID(request *RegisterID) error {
|
|
|
|
+ envelope := request // TODO
|
|
|
|
+ if err := bus.NATS.Publish("id.register", envelope); err != nil {
|
|
|
|
+ return fmt.Errorf("failed to enqueue ID registration: %w", err)
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (bus *Bus) VerifyEmail(request *VerifyEmail) error {
|
|
|
|
+ envelope := request // TODO
|
|
|
|
+ if err := bus.NATS.Publish("id.verify", envelope); err != nil {
|
|
|
|
+ return fmt.Errorf("failed to enqueue ID verification: %w", err)
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (bus *Bus) GrantAccess(request *GrantAccess) error {
|
|
|
|
+ envelope := request // TODO
|
|
|
|
+ if err := bus.NATS.Publish("access.grant", envelope); err != nil {
|
|
|
|
+ return fmt.Errorf("failed to enqueue access grant: %w", err)
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (bus *Bus) RevokeAccess(request *RevokeAccess) error {
|
|
|
|
+ envelope := request // TODO
|
|
|
|
+ if err := bus.NATS.Publish("access.revoke", envelope); err != nil {
|
|
|
|
+ return fmt.Errorf("failed to enqueue access revocation: %w", err)
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|