parcoursmob/handlers/api/api.go

31 lines
775 B
Go
Raw Normal View History

package api
import (
"net/http"
"git.coopgo.io/coopgo-apps/parcoursmob/services"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
cache "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
"github.com/spf13/viper"
)
type APIHandler struct {
idp *identification.IdentificationProvider
config *viper.Viper
services *services.ServicesHandler
cache cache.CacheHandler
}
func NewAPIHandler(cfg *viper.Viper, idp *identification.IdentificationProvider, svc *services.ServicesHandler, cache cache.CacheHandler) (*APIHandler, error) {
return &APIHandler{
idp: idp,
config: cfg,
services: svc,
cache: cache,
}, nil
}
func (h *APIHandler) NotFound(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
}