summaryrefslogtreecommitdiff
path: root/internal/daemon/daemon.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/daemon/daemon.go')
-rw-r--r--internal/daemon/daemon.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go
index 876fc81..852051a 100644
--- a/internal/daemon/daemon.go
+++ b/internal/daemon/daemon.go
@@ -24,6 +24,7 @@ const (
defaultIdleTimeout = 2 * time.Minute
)
+// Config holds settings for the HTTP report/upload daemon.
type Config struct {
StatsDir string
Addr string
@@ -107,6 +108,7 @@ func newDaemonHTTPServer(addr string, handler http.Handler, errLog *log.Logger)
}
}
+// Run starts the HTTP server for cfg until ctx is canceled, then shuts down gracefully.
func Run(ctx context.Context, cfg Config) error {
if cfg.StatsDir == "" {
return fmt.Errorf("stats directory is required")