• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jo-hoe / video-to-podcast-service / 16531004876

25 Jul 2025 08:28PM UTC coverage: 23.354% (-0.4%) from 23.792%
16531004876

push

github

jo-hoe
moved config to a central place

0 of 39 new or added lines in 3 files covered. (0.0%)

4 existing lines in 2 files now uncovered.

266 of 1139 relevant lines covered (23.35%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/server/server.go
1
package server
2

3
import (
4
        "fmt"
5
        "log"
6
        "net/http"
7

8
        "github.com/jo-hoe/video-to-podcast-service/internal/config"
9
        "github.com/jo-hoe/video-to-podcast-service/internal/core"
10
        "github.com/jo-hoe/video-to-podcast-service/internal/core/database"
11
        "github.com/jo-hoe/video-to-podcast-service/internal/server/api"
12
        "github.com/jo-hoe/video-to-podcast-service/internal/server/ui"
13

14
        "github.com/go-playground/validator"
15
        "github.com/labstack/echo/v4"
16
        "github.com/labstack/echo/v4/middleware"
17
)
18

NEW
19
func StartServer(cfg *config.Config, databaseService database.DatabaseService) {
×
UNCOV
20

×
21
        e := echo.New()
×
22
        e.Use(middleware.Logger())
×
23
        e.Use(middleware.Recover())
×
24
        e.Pre(middleware.RemoveTrailingSlash())
×
25

×
26
        e.Validator = &genericValidator{Validator: validator.New()}
×
27

×
NEW
28
        coreService := core.NewCoreService(databaseService, cfg.Storage.BasePath)
×
29

×
NEW
30
        apiService := api.NewAPIService(coreService, cfg.Server.Port)
×
31
        apiService.SetAPIRoutes(e)
×
32

×
33
        uiService := ui.NewUIService(coreService)
×
34
        uiService.SetUIRoutes(e)
×
35

×
36
        // start server
×
37
        log.Print("starting server")
×
NEW
38
        log.Printf("UI available at http://localhost:%s/%s", cfg.Server.Port, ui.MainPageName)
×
NEW
39
        log.Printf("Explore all feeds via API at http://localhost:%s/%s ", cfg.Server.Port, api.FeedsPath)
×
NEW
40
        e.Logger.Fatal(e.Start(fmt.Sprintf(":%s", cfg.Server.Port)))
×
UNCOV
41
}
×
42

43
type genericValidator struct {
44
        Validator *validator.Validate
45
}
46

47
func (gv *genericValidator) Validate(i interface{}) error {
×
48
        if err := gv.Validator.Struct(i); err != nil {
×
49
                return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("received invalid request body: %v", err))
×
50
        }
×
51
        return nil
×
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc