bazaar/cmd/bazaar/main.go

36 lines
1.1 KiB
Go
Raw Normal View History

2022-01-02 22:11:00 +00:00
package main
import (
"context"
"log"
"github.com/fmartingr/bazaar/internal/server"
2022-01-02 22:11:00 +00:00
"github.com/fmartingr/bazaar/pkg/manager"
"github.com/fmartingr/bazaar/pkg/shop/akiracomics"
"github.com/fmartingr/bazaar/pkg/shop/amazon"
2022-08-06 07:08:52 +00:00
"github.com/fmartingr/bazaar/pkg/shop/casadellibro"
2022-07-02 14:27:52 +00:00
"github.com/fmartingr/bazaar/pkg/shop/gtmstore"
"github.com/fmartingr/bazaar/pkg/shop/heroesdepapel"
"github.com/fmartingr/bazaar/pkg/shop/steam"
2022-01-02 22:11:00 +00:00
)
func main() {
m := manager.NewManager()
m.Register(akiracomics.Domains, akiracomics.NewAkiraShopFactory())
m.Register(steam.Domains, steam.NewSteamShopFactory())
m.Register(heroesdepapel.Domains, heroesdepapel.NewHeroesDePapelShopFactory())
m.Register(amazon.Domains, amazon.NewAmazonShopFactory())
2022-07-02 14:27:52 +00:00
m.Register(gtmstore.Domains, gtmstore.NewGTMStoreShopFactory())
2022-08-06 07:08:52 +00:00
m.Register(casadellibro.Domains, casadellibro.NewCasaDelLibroShopFactory())
2022-01-02 22:11:00 +00:00
ctx := context.Background()
server := server.NewServer(server.ParseServerConfiguration(ctx), &m)
2022-01-02 22:11:00 +00:00
if err := server.Start(ctx); err != nil {
log.Panicf("error starting server: %s", err)
}
server.WaitStop()
2022-01-02 22:11:00 +00:00
}