瀏覽代碼

API: first OpenAPI version.

Frédéric G. MARAND 1 年之前
父節點
當前提交
eac7b943aa
共有 4 個文件被更改,包括 321 次插入15 次删除
  1. 3 1
      .gitignore
  2. 297 0
      api/dlq.yml
  3. 12 12
      back/cmd/redriver/main.go
  4. 9 2
      back/services/redriver.go

+ 3 - 1
.gitignore

@@ -1,2 +1,4 @@
 /.idea
-volume
+.yarn
+node_modules
+volume

File diff suppressed because it is too large
+ 297 - 0
api/dlq.yml


+ 12 - 12
back/cmd/redriver/main.go

@@ -8,7 +8,7 @@ import (
 
 	"github.com/fgm/izidic"
 
-	services2 "code.osinet.fr/fgm/sqs_demo/back/services"
+	"code.osinet.fr/fgm/sqs_demo/services"
 )
 
 func main() {
@@ -18,10 +18,10 @@ func main() {
 func main2(w io.Writer, name string, args []string) (exitCode byte) {
 	ctx := context.Background()
 	dic := Resolve(w, name, args)
-	lister := dic.MustService(services2.SvcLister).(func(ctx context.Context) string)
+	lister := dic.MustService(services.SvcLister).(func(ctx context.Context) string)
 	qURL := lister(ctx)
 
-	producer := dic.MustService(services2.SvcProducer).(func(ctx context.Context, qName string))
+	producer := dic.MustService(services.SvcProducer).(func(ctx context.Context, qName string))
 	producer(ctx, qURL)
 
 	log.Printf("exiting cleanly")
@@ -30,17 +30,17 @@ func main2(w io.Writer, name string, args []string) (exitCode byte) {
 
 func Resolve(w io.Writer, name string, args []string) *izidic.Container {
 	dic := izidic.New()
-	dic.Store(services2.PName, name)
-	dic.Store(services2.PArgs, args)
-	dic.Store(services2.PWriter, w)
+	dic.Store(services.PName, name)
+	dic.Store(services.PArgs, args)
+	dic.Store(services.PWriter, w)
 
-	dic.Register(services2.SvcClient, services2.SQSClientService)
-	dic.Register(services2.SvcFlags, services2.FlagsService)
-	dic.Register(services2.SvcLister, services2.ListerService)
-	dic.Register(services2.SvcLogger, services2.LoggerService)
-	dic.Register(services2.SvcProducer, services2.ProducerService)
+	dic.Register(services.SvcClient, services.SQSClientService)
+	dic.Register(services.SvcFlags, services.FlagsService)
+	dic.Register(services.SvcLister, services.ListerService)
+	dic.Register(services.SvcLogger, services.LoggerService)
+	dic.Register(services.SvcProducer, services.ProducerService)
 
-	dic.MustService(services2.SvcFlags) // Store generated params before freeze.
+	dic.MustService(services.SvcFlags) // Store generated params before freeze.
 	dic.Freeze()
 	return dic
 }

+ 9 - 2
back/services/redriver.go

@@ -14,9 +14,16 @@ type CreateMoveTaskOutput struct {
 	ApproximateNumberOfMessagesMoved int
 }
 
+// Redriver defines the behavior of DLQ redriver services.
+//
+// See https://github.com/aws/aws-sdk-go-v2/issues/1991
+// about the commented-out methods.
 type Redriver interface {
-	CreateMoveTask()
-	ListMoveTasks() []any
+	// CreateMoveTask()
+
+	// ListMoveTasks() []any
+
+	ListDLQs() map[string]string
 }
 
 type redriver struct {

Some files were not shown because too many files changed in this diff