controller.go 533 B

1234567891011121314151617181920212223242526
  1. package controller
  2. import (
  3. "io/fs"
  4. "git.aetherial.dev/aeth/keiji/pkg/auth"
  5. "git.aetherial.dev/aeth/keiji/pkg/storage"
  6. )
  7. type Controller struct {
  8. Domain string
  9. database storage.DocumentIO
  10. Cache *auth.AuthCache
  11. AuthSource auth.Source
  12. FileIO fs.FS
  13. }
  14. func NewController(domain string, database storage.DocumentIO, files fs.FS, authSrc auth.Source) *Controller {
  15. return &Controller{
  16. Cache: auth.NewCache(),
  17. AuthSource: authSrc,
  18. Domain: domain,
  19. database: database,
  20. FileIO: files,
  21. }
  22. }