|
@@ -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
|
|
|
}
|