restructuring, config and readme

This commit is contained in:
u80864958
2025-04-29 14:57:48 +02:00
parent f027ee7e39
commit fc8b888198
19 changed files with 317 additions and 185 deletions

View File

@ -0,0 +1,26 @@
package auth
import (
"time"
"gorm.io/gorm"
)
type Config struct {
Secret string `env:"SECRET"`
ValidDuration time.Duration `env:"VALID_DURATION"`
AdminName string `env:"ADMIN_NAME"`
AdminPassword string `env:"ADMIN_PASSWORD"`
}
type Service struct {
cfg *Config
db *gorm.DB
}
func New(cfg *Config, db *gorm.DB) *Service {
return &Service{
cfg,
db,
}
}