aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorRanXom <saiyedshizain@gmail.com>2026-07-13 15:43:59 +0530
committerRanXom <saiyedshizain@gmail.com>2026-07-13 15:43:59 +0530
commit0bf573c82118aaa5b60ab381dee26f43b10004b3 (patch)
tree09905c84f66d87fc6eacff9e8a8ccbdaa8123fe3 /internal
parent5029457e4ebe028995cb0f05ea76687aa4aa8b42 (diff)
downloadgalleryd-0bf573c82118aaa5b60ab381dee26f43b10004b3.tar.xz
galleryd-0bf573c82118aaa5b60ab381dee26f43b10004b3.zip
feat(api): wire application services
Diffstat (limited to 'internal')
-rw-r--r--internal/api/config.go4
-rw-r--r--internal/api/new.go7
-rw-r--r--internal/api/server.go4
3 files changed, 12 insertions, 3 deletions
diff --git a/internal/api/config.go b/internal/api/config.go
index 953421d..d82147c 100644
--- a/internal/api/config.go
+++ b/internal/api/config.go
@@ -1,6 +1,10 @@
package api
+import "github.com/RanXom/galleryd/internal/service"
+
// Config configures the HTTP server
type Config struct {
Address string
+
+ Gallery service.GalleryService
}
diff --git a/internal/api/new.go b/internal/api/new.go
index d225b02..4941496 100644
--- a/internal/api/new.go
+++ b/internal/api/new.go
@@ -11,9 +11,10 @@ func New(config Config) *Server {
}
srv := &Server{
- config: config,
- mux: mux,
- http: server,
+ config: config,
+ mux: mux,
+ http: server,
+ gallery: config.Gallery,
}
srv.mux.HandleFunc(
diff --git a/internal/api/server.go b/internal/api/server.go
index c455683..c12c5bd 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -2,6 +2,8 @@ package api
import (
"net/http"
+
+ "github.com/RanXom/galleryd/internal/service"
)
// Server exposes the gallery over HTTP
@@ -10,4 +12,6 @@ type Server struct {
mux *http.ServeMux
http *http.Server
+
+ gallery service.GalleryService
}