package handlers
import (
"database/sql"
"html/template"
"net/http"
"git.tavo.one/tavo/axiom/storage"
)
type Handler struct {
cfg Config
mux *http.ServeMux
}
type Config struct {
Production bool
Views map[string]*template.Template
DB *sql.DB
S3 *storage.Client
}
func New(cfg Config) *Handler {
return &Handler{
cfg: cfg,
}
}
func (h *Handler) Router() *http.ServeMux {
return h.mux
}
func (h *Handler) Production() bool {
return h.cfg.Production
}
func (h *Handler) Views() map[string]*template.Template {
return h.cfg.Views
}
func (h *Handler) DB() *sql.DB {
return h.cfg.DB
}
func (h *Handler) S3() *storage.Client {
return h.cfg.S3
}