Documentation ¶
Index ¶
- type ImageQueueMessage
- type MockService
- func (q MockService) DeleteImage(img *ImageQueueMessage) error
- func (q MockService) DeleteNotification(notify *NotificationQueueMessage) error
- func (q MockService) ReceiveImage() *ImageQueueMessage
- func (q MockService) ReceiveNotification() *NotificationQueueMessage
- func (q MockService) SendImage(imageName string, state string) (err error)
- func (q MockService) SendNotification(id uint) (err error)
- type NatsService
- func (q NatsService) DeleteImage(img *ImageQueueMessage) error
- func (q NatsService) DeleteNotification(notification *NotificationQueueMessage) error
- func (q NatsService) ReceiveImage() *ImageQueueMessage
- func (q NatsService) ReceiveNotification() *NotificationQueueMessage
- func (q NatsService) SendImage(imageName string, state string) (err error)
- func (q NatsService) SendNotification(notificationID uint) (err error)
- type NotificationQueueMessage
- type Service
- type SqsService
- func (q SqsService) DeleteImage(img *ImageQueueMessage) error
- func (q SqsService) DeleteNotification(notification *NotificationQueueMessage) error
- func (q SqsService) ReceiveImage() *ImageQueueMessage
- func (q SqsService) ReceiveNotification() *NotificationQueueMessage
- func (q SqsService) SendImage(imageName string, state string) (err error)
- func (q SqsService) SendNotification(notificationID uint) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageQueueMessage ¶
ImageQueueMessage is sent to the queue to trigger an inspection.
type MockService ¶
type MockService struct{}
MockService for tests
func NewMockService ¶
func NewMockService() MockService
func (MockService) DeleteImage ¶
func (q MockService) DeleteImage(img *ImageQueueMessage) error
DeleteImage on mock queue always succeeds
func (MockService) DeleteNotification ¶
func (q MockService) DeleteNotification(notify *NotificationQueueMessage) error
DeleteNotification on mock queue always succeeds
func (MockService) ReceiveImage ¶
func (q MockService) ReceiveImage() *ImageQueueMessage
ReceiveImage on mock queue always succeeds
func (MockService) ReceiveNotification ¶
func (q MockService) ReceiveNotification() *NotificationQueueMessage
ReceiveNotification on mock queue always succeeds
func (MockService) SendImage ¶
func (q MockService) SendImage(imageName string, state string) (err error)
SendImage on mock queue always succeeds
func (MockService) SendNotification ¶
func (q MockService) SendNotification(id uint) (err error)
SendNotification on mock queue always succeeds
type NatsService ¶
type NatsService struct {
// contains filtered or unexported fields
}
NatsService for sending and receiving messages to Nats.
func NewNatsService ¶
func NewNatsService() NatsService
NewNatsService opens a new session with Nats.
func (NatsService) DeleteImage ¶
func (q NatsService) DeleteImage(img *ImageQueueMessage) error
DeleteImage from the queue once it has successfully been inspected.
func (NatsService) DeleteNotification ¶
func (q NatsService) DeleteNotification(notification *NotificationQueueMessage) error
DeleteNotification from the queue once it has been sent.
func (NatsService) ReceiveImage ¶
func (q NatsService) ReceiveImage() *ImageQueueMessage
ReceiveImage from the Nats queue for processing by the inspector.
func (NatsService) ReceiveNotification ¶
func (q NatsService) ReceiveNotification() *NotificationQueueMessage
ReceiveNotification from the SQS queue for sending by the notifier
func (NatsService) SendImage ¶
func (q NatsService) SendImage(imageName string, state string) (err error)
SendImage to the Nats queue for processing by the Inspector.
func (NatsService) SendNotification ¶
func (q NatsService) SendNotification(notificationID uint) (err error)
SendNotification to the SQS queue for processing by the Notifier.
type NotificationQueueMessage ¶
type NotificationQueueMessage struct { NotificationID uint `json:"NotificationID"` ReceiptHandle *string }
NotificationQueueMessage is sent to the queue to trigger a notification.
type Service ¶
type Service interface { SendImage(imageName string, state string) (err error) ReceiveImage() *ImageQueueMessage DeleteImage(img *ImageQueueMessage) error SendNotification(notificationID uint) error ReceiveNotification() *NotificationQueueMessage DeleteNotification(notify *NotificationQueueMessage) error }
Service interface so we can mock it out for tests TODO!! There must be a cleaner way that doesn't involve a different set of methods for each type of message
type SqsService ¶
type SqsService struct {
// contains filtered or unexported fields
}
SqsService for sending and receiving messages on SQS
func (SqsService) DeleteImage ¶
func (q SqsService) DeleteImage(img *ImageQueueMessage) error
DeleteImage from the queue once it has successfully been inspected.
func (SqsService) DeleteNotification ¶
func (q SqsService) DeleteNotification(notification *NotificationQueueMessage) error
DeleteNotification from the queue once it has been sent.
func (SqsService) ReceiveImage ¶
func (q SqsService) ReceiveImage() *ImageQueueMessage
ReceiveImage from the SQS queue for processing by the inspector.
func (SqsService) ReceiveNotification ¶
func (q SqsService) ReceiveNotification() *NotificationQueueMessage
ReceiveNotification from the SQS queue for sending by the notifier
func (SqsService) SendImage ¶
func (q SqsService) SendImage(imageName string, state string) (err error)
SendImage to the SQS queue for processing by the Inspector.
func (SqsService) SendNotification ¶
func (q SqsService) SendNotification(notificationID uint) (err error)
SendNotification to the SQS queue for processing by the Notifier.