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

matzefriedrich / containerssh-authserver / 23028829480

12 Mar 2026 11:30PM UTC coverage: 24.57% (-0.008%) from 24.578%
23028829480

Pull #42

github

matzefriedrich
Updates the CHANGELOG
Pull Request #42: feature/upgrade-go-fiber-v3

16 of 56 new or added lines in 12 files covered. (28.57%)

29 existing lines in 5 files now uncovered.

143 of 582 relevant lines covered (24.57%)

0.31 hits per line

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

0.0
/internal/application.go
1
package internal
2

3
import (
4
        "bufio"
5
        "context"
6
        "fmt"
7
        "io/fs"
8

9
        fiberzerolog "github.com/gofiber/contrib/v3/zerolog"
10
        "github.com/gofiber/fiber/v3"
11
        "github.com/matzefriedrich/containerssh-authserver/internal/resources"
12
        "github.com/rs/zerolog"
13

14
        "github.com/matzefriedrich/containerssh-authserver/internal/configuration"
15
        "github.com/matzefriedrich/containerssh-authserver/internal/handlers"
16

17
        "github.com/matzefriedrich/parsley/pkg/bootstrap"
18
)
19

20
type authServerApplication struct {
21
        app             *fiber.App
22
        config          *configuration.ApplicationConfiguration
23
        logger          *zerolog.Logger
24
        applicationInfo *configuration.ApplicationInfo
25
}
26

UNCOV
27
// Run starts the application server and listens on the configured port. Returns an error if the server fails to start.
×
NEW
28
func (a *authServerApplication) Run(ctx context.Context) error {
×
29

×
30
        a.printApplicationInfo()
×
31
        a.printBanner()
×
32

×
33
        listenAddress := fmt.Sprintf(":%d", a.config.Port)
×
NEW
34
        return a.app.Listen(listenAddress, fiber.ListenConfig{
×
NEW
35
                GracefulContext:       ctx,
×
NEW
36
                DisableStartupMessage: true,
×
NEW
37
        })
×
UNCOV
38
}
×
UNCOV
39

×
40
func (a *authServerApplication) printApplicationInfo() {
×
41
        a.logger.Info().Msgf("Starting %s", a.applicationInfo.ReleaseName)
×
42
        a.logger.Info().Msgf("Version: %s", a.applicationInfo.VersionString())
×
43
        a.logger.Info().Msgf("Port: %d", a.config.Port)
×
44

×
45
        a.logger.Info().Msgf("Configuration path: %s", a.applicationInfo.ConfigurationPath)
×
46
        a.logger.Info().Msgf("Configuration type: %s", a.applicationInfo.ConfigurationType)
×
47
}
×
UNCOV
48

×
49
func (a *authServerApplication) printBanner() {
×
50

×
51
        bannerFile, _ := resources.Resources.Open(resources.BannerTxt)
×
NEW
52
        defer func(bannerFile fs.File) {
×
NEW
53
                _ = bannerFile.Close()
×
NEW
54
        }(bannerFile)
×
55

×
56
        scanner := bufio.NewScanner(bannerFile)
×
57
        for scanner.Scan() {
×
58
                line := scanner.Text()
×
59
                a.logger.Info().Msg(line)
×
60
        }
×
61
}
62

63
var _ bootstrap.Application = (*authServerApplication)(nil)
64

65
// NewFiberApp initializes and configures a Fiber application with the provided route handlers, configuration, and logger.
66
func NewFiberApp(
67
        app *fiber.App,
UNCOV
68
        routeHandlers []handlers.RouteHandler,
×
UNCOV
69
        config *configuration.ApplicationConfiguration,
×
UNCOV
70
        applicationInfo *configuration.ApplicationInfo,
×
71
        logger *zerolog.Logger) bootstrap.Application {
×
72

×
73
        app.Use(fiberzerolog.New(fiberzerolog.Config{
×
74
                Logger: logger,
×
75
        }))
×
76

×
77
        // Register RouteHandler services with the resolved Fiber instance.
×
78
        for _, routeHandler := range routeHandlers {
×
79
                routeHandler.Register(app)
×
80
        }
×
UNCOV
81

×
82
        return &authServerApplication{
×
83
                app:             app,
×
84
                config:          config,
×
85
                applicationInfo: applicationInfo,
×
86
                logger:          logger,
×
87
        }
×
88
}
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