-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (36 loc) · 844 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"context"
"github.com/hugolesta/go-inventory-api/database"
"github.com/hugolesta/go-inventory-api/internal/repository"
"github.com/hugolesta/go-inventory-api/internal/service"
"github.com/hugolesta/go-inventory-api/internal/settings"
"go.uber.org/fx"
)
func main() {
app := fx.New(
fx.Provide(
context.Background,
settings.New,
database.New,
repository.New,
service.New,
),
fx.Invoke(
// func(ctx context.Context, serv service.Service){
// err := serv.RegisterUser(ctx, "my@email.com", "myname", "mypassword")
// if err != nil {
// panic(err)
// }
// u, err := serv.LoginUser(ctx, "my@email.com", "mypassword")
// if err != nil {
// panic(err)
// }
// if u.Name != "myname" {
// panic("invalid name")
// }
// },
),
)
app.Run()
}