redriver.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package services
  2. import (
  3. "context"
  4. "io"
  5. "github.com/aws/aws-sdk-go-v2/service/sqs"
  6. "github.com/fgm/izidic"
  7. )
  8. type CreateMoveTaskOutput struct {
  9. Status *string // Running
  10. SourceARN *string
  11. ApproximateNumberOfMessagesMoved int
  12. }
  13. // Redriver defines the behavior of DLQ redriver services.
  14. //
  15. // See https://github.com/aws/aws-sdk-go-v2/issues/1991
  16. // about the commented-out methods.
  17. type Redriver interface {
  18. // CreateMoveTask()
  19. // ListMoveTasks() []any
  20. ListDLQs() map[string]string
  21. }
  22. type redriver struct {
  23. }
  24. func (r redriver) CreateMoveTask() {
  25. // TODO implement me
  26. // u := url.URL{
  27. // Scheme: "https",
  28. // User: nil,
  29. // Host: "",
  30. // Path: "",
  31. // RawPath: "",
  32. // OmitHost: false,
  33. // ForceQuery: false,
  34. // RawQuery: "",
  35. // Fragment: "",
  36. // RawFragment: "",
  37. // }
  38. /*
  39. Action=CreateMoveTask
  40. &SourceArn=arn%3Aaws%3Asqs%3Aeu-west-3%3A751146239996%3Atest-dlq
  41. &TaskName=079228fe-098b-436d-a2f4-cb4d29ebb55a
  42. &Version=2012-11-05
  43. */
  44. }
  45. func (r redriver) ListMoveTasks() []any {
  46. // TODO implement me
  47. panic("implement me")
  48. }
  49. func RedriverService(dic *izidic.Container) (any, error) {
  50. cli := dic.MustService(SvcClient).(*sqs.Client)
  51. w := dic.MustParam(PWriter).(io.Writer)
  52. return func(ctx context.Context, qName string) {
  53. senderHandler(ctx, w, cli, qName)
  54. }, nil
  55. }