diff --git a/infrastructure/acme/setting.go b/infrastructure/acme/setting.go index ea37bba..0e1df0e 100644 --- a/infrastructure/acme/setting.go +++ b/infrastructure/acme/setting.go @@ -1,7 +1,7 @@ package acme import ( - "autossl/middleware" + "autossl/module" "go.uber.org/zap" "os" "os/exec" @@ -10,7 +10,7 @@ import ( ) var usr, _ = user.Current() -var logger = middleware.GetLogger() +var logger = module.GetLogger() func InitAcme() { ca() diff --git a/main.go b/main.go index 72f0102..d8235d6 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,7 @@ package main import ( "autossl/infrastructure/acme" - "autossl/middleware" + "autossl/module" "autossl/web" "github.com/golang-jwt/jwt/v5" echojwt "github.com/labstack/echo-jwt/v4" @@ -15,7 +15,7 @@ func main() { // JWT secret := os.Getenv("ADMIN_PASSWORD") - skipTokenMiddleware := middleware.Skip + skipTokenMiddleware := module.Skip jwtMiddleware := echojwt.WithConfig(echojwt.Config{ NewClaimsFunc: func(c echo.Context) jwt.Claims { return new(web.JWTCustomClaims) @@ -31,7 +31,7 @@ func main() { web.LoginRoutes(e) // Logger - e.Use(middleware.RequestLogger()) + e.Use(module.RequestLogger()) // Init acme.sh acme.InitAcme() diff --git a/middleware/jwt.go b/module/jwt.go similarity index 93% rename from middleware/jwt.go rename to module/jwt.go index b913feb..61ca286 100644 --- a/middleware/jwt.go +++ b/module/jwt.go @@ -1,4 +1,4 @@ -package middleware +package module import "github.com/labstack/echo/v4" diff --git a/middleware/logger.go b/module/logger.go similarity index 98% rename from middleware/logger.go rename to module/logger.go index d5ef58c..be324d4 100644 --- a/middleware/logger.go +++ b/module/logger.go @@ -1,4 +1,4 @@ -package middleware +package module import ( "github.com/labstack/echo/v4"