From 0bf573c82118aaa5b60ab381dee26f43b10004b3 Mon Sep 17 00:00:00 2001 From: RanXom Date: Mon, 13 Jul 2026 15:43:59 +0530 Subject: feat(api): wire application services --- internal/api/config.go | 4 ++++ internal/api/new.go | 7 ++++--- internal/api/server.go | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'internal') 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 } -- cgit v1.2.3