redriver.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. type Redriver interface {
  14. CreateMoveTask()
  15. ListMoveTasks() []any
  16. }
  17. type redriver struct {
  18. }
  19. func (r redriver) CreateMoveTask() {
  20. // TODO implement me
  21. // u := url.URL{
  22. // Scheme: "https",
  23. // User: nil,
  24. // Host: "",
  25. // Path: "",
  26. // RawPath: "",
  27. // OmitHost: false,
  28. // ForceQuery: false,
  29. // RawQuery: "",
  30. // Fragment: "",
  31. // RawFragment: "",
  32. // }
  33. /*
  34. Action=CreateMoveTask
  35. &SourceArn=arn%3Aaws%3Asqs%3Aeu-west-3%3A751146239996%3Atest-dlq
  36. &TaskName=079228fe-098b-436d-a2f4-cb4d29ebb55a
  37. &Version=2012-11-05
  38. */
  39. }
  40. func (r redriver) ListMoveTasks() []any {
  41. // TODO implement me
  42. panic("implement me")
  43. }
  44. func RedriverService(dic *izidic.Container) (any, error) {
  45. cli := dic.MustService(SvcClient).(*sqs.Client)
  46. w := dic.MustParam(PWriter).(io.Writer)
  47. return func(ctx context.Context, qName string) {
  48. senderHandler(ctx, w, cli, qName)
  49. }, nil
  50. }