installed gin
This commit is contained in:
@@ -50,24 +50,6 @@ func main() {
|
||||
// Time format (Default: time.StampMilli)
|
||||
//TimeFormat: "",
|
||||
}))
|
||||
/*
|
||||
logger := slog.New(tint.NewHandler(os.Stderr, &tint.Options{
|
||||
AddSource: true,
|
||||
Level: slog.LevelDebug,
|
||||
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
|
||||
// this can perform general key=value log cleanup
|
||||
|
||||
if a.Key == slog.SourceKey && len(groups) == 0 {
|
||||
source := a.Value.Any().(*slog.Source)
|
||||
source.File = strings.TrimPrefix(source.File, "/home/angel/go/src/ruben/inventory2/internal")
|
||||
}
|
||||
|
||||
return a
|
||||
},
|
||||
// Time format (Default: time.StampMilli)
|
||||
//TimeFormat: "",
|
||||
}))
|
||||
*/
|
||||
|
||||
logger.Info("application starting")
|
||||
|
||||
@@ -168,25 +150,27 @@ func runAuthProcesses(ctx context.Context, auth *authentication.Authenticator) <
|
||||
}
|
||||
|
||||
func runServer(ctx context.Context, logger *logging.Logger, connPool *pgxpool.Pool, auth *authentication.Authenticator) <-chan error {
|
||||
srv := &http.Server{
|
||||
Addr: ":8082", // local
|
||||
Handler: server.NewServer(
|
||||
ctx,
|
||||
logger.WithGroup("server"),
|
||||
"./",
|
||||
raw_events.NewStore(logger.WithGroup("raw-event-store"), connPool),
|
||||
accounts.NewStore(logger, connPool),
|
||||
etsy_platform.NewPlatform(
|
||||
logger,
|
||||
func(acctID int64) string {
|
||||
return fmt.Sprintf("/oauth/account/%d/auth_code", acctID)
|
||||
},
|
||||
etsyAPIKeystring,
|
||||
etsyAPISharedSecret,
|
||||
connPool,
|
||||
),
|
||||
auth,
|
||||
r := server.Router(
|
||||
ctx,
|
||||
logger.WithGroup("server"),
|
||||
"./",
|
||||
raw_events.NewStore(logger.WithGroup("raw-event-store"), connPool),
|
||||
accounts.NewStore(logger, connPool),
|
||||
etsy_platform.NewPlatform(
|
||||
logger,
|
||||
func(acctID int64) string {
|
||||
return fmt.Sprintf("/oauth/account/%d/auth_code", acctID)
|
||||
},
|
||||
etsyAPIKeystring,
|
||||
etsyAPISharedSecret,
|
||||
connPool,
|
||||
),
|
||||
auth,
|
||||
)
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: ":8082", // local
|
||||
Handler: r,
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
|
||||
Reference in New Issue
Block a user