mirror of
https://github.com/mmahdium/TGSS.git
synced 2026-08-14 17:52:49 +03:30
feat: initialize project structure with configuration, logging, and Telegram integration
- Added configuration loading from environment variables with default session path handling. - Implemented a logger using Uber's zap library. - Created a basic HTTP server with Gin and CORS support. - Established Telegram client and service for message retrieval. - Introduced initial API routes and handlers. - Added necessary dependencies in go.sum.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"tgss/internal/config"
|
||||
"tgss/internal/infra"
|
||||
"tgss/internal/server"
|
||||
"tgss/internal/telegram"
|
||||
"time"
|
||||
|
||||
"go.uber.org/fx"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := fx.New(
|
||||
fx.Provide(
|
||||
infra.NewLogger,
|
||||
config.Load,
|
||||
server.NewGin,
|
||||
),
|
||||
telegram.Module,
|
||||
fx.Logger(infra.NewFXLogger()),
|
||||
)
|
||||
|
||||
startCtx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
if err := app.Start(startCtx); err != nil {
|
||||
log.Fatalf("failed to start: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user