This commit is contained in:
1 parent
72bc974aa6
commit
9ec2585030
12 files changed
+299
-54
No files matched your search
@@ -28,12 +28,16 @@ func New(renderer renderer, srv galleryService, cfg *config.Gallery) *Handler {
|
||||
cfg: cfg,
|
||||
}
|
||||
|
||||
mux.HandleFunc(fmt.Sprintf("GET /%s", url.PathEscape(cfg.Path)), h.gallery)
|
||||
galleryPath := url.PathEscape(cfg.Path)
|
||||
|
||||
mux.HandleFunc(fmt.Sprintf("GET /%s/{image_uid}", galleryPath), h.image)
|
||||
mux.HandleFunc(fmt.Sprintf("GET /%s", galleryPath), h.gallery)
|
||||
return h
|
||||
}
|
||||
|
||||
type galleryService interface {
|
||||
GetGallerySet(ctx context.Context) (gallerySet gallery.Set, err error)
|
||||
GetPrevAndNext(ctx context.Context, uid string) (previous *gallery.Image, next *gallery.Image, err error)
|
||||
}
|
||||
type renderer interface {
|
||||
Render(ctx context.Context, w io.Writer, r *http.Request, component templ.Component)
|
||||
|
||||
Reference in new issue
Block a user