aboutsummaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api')
-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
}