handlers.go 337 B

1234567891011121314151617181920212223
  1. package handlers
  2. import (
  3. "github.com/go-playground/validator/v10"
  4. "notabug.org/alimiracle/my-website-api/db"
  5. )
  6. type Handler struct {
  7. Database db.Database
  8. validate *validator.Validate
  9. }
  10. func Init() Handler {
  11. var data Handler
  12. data.Database = db.Init()
  13. data.validate = validator.New()
  14. data.Database.AddAdmin()
  15. return data
  16. }