Skip to content

Commit 6997b97

Browse files
authored
feat: Gleece Init Command (#72)
Adds an 'init' command to the CLI; The init command enables users to get started quickly via a CLI wizard that creates the necessary configuration and some of the boilerplate code
1 parent 44c28c5 commit 6997b97

21 files changed

Lines changed: 1468 additions & 159 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ dist/
2828
temp/
2929

3030
__debug*
31+
32+
.idea/

cmd/embed/auth.middleware.chi.hbs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package {{{PkgAlias}}}
2+
3+
import (
4+
"context"
5+
"net/http"
6+
7+
"github.com/gopher-fleece/runtime"
8+
)
9+
10+
func GleeceRequestAuthorization(ctx context.Context, r *http.Request, check runtime.SecurityCheck) (context.Context, *runtime.SecurityError) {
11+
return ctx, nil
12+
}

cmd/embed/auth.middleware.echo.hbs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package {{{PkgAlias}}}
2+
3+
import (
4+
"context"
5+
6+
"github.com/gopher-fleece/runtime"
7+
"github.com/labstack/echo/v4"
8+
)
9+
10+
func GleeceRequestAuthorization(ctx context.Context, echoCtx echo.Context, check runtime.SecurityCheck) (context.Context, *runtime.SecurityError) {
11+
return ctx, nil
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package {{{PkgAlias}}}
2+
3+
import (
4+
"context"
5+
6+
"github.com/gofiber/fiber/v2"
7+
"github.com/gopher-fleece/runtime"
8+
)
9+
10+
func GleeceRequestAuthorization(ctx context.Context, fiberCtx *fiber.Ctx, check runtime.SecurityCheck) (context.Context, *runtime.SecurityError) {
11+
return ctx, nil
12+
}

cmd/embed/auth.middleware.gin.hbs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package {{{PkgAlias}}}
2+
3+
import (
4+
"context"
5+
6+
"github.com/gin-gonic/gin"
7+
"github.com/gopher-fleece/runtime"
8+
)
9+
10+
func GleeceRequestAuthorization(ctx context.Context, ginCtx *gin.Context, check runtime.SecurityCheck) (context.Context, *runtime.SecurityError) {
11+
return ctx, nil
12+
}

cmd/embed/auth.middleware.mux.hbs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package {{{PkgAlias}}}
2+
3+
import (
4+
"context"
5+
"net/http"
6+
7+
"github.com/gopher-fleece/runtime"
8+
)
9+
10+
func GleeceRequestAuthorization(ctx context.Context, r *http.Request, check runtime.SecurityCheck) (context.Context, *runtime.SecurityError) {
11+
return ctx, nil
12+
}

cmd/embed/embeds.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package embed
2+
3+
import (
4+
_ "embed"
5+
)
6+
7+
//go:embed auth.middleware.chi.hbs
8+
var ChiAuthMiddleware string
9+
10+
//go:embed auth.middleware.echo.hbs
11+
var EchoAuthMiddleware string
12+
13+
//go:embed auth.middleware.fiber.hbs
14+
var FiberAuthMiddleware string
15+
16+
//go:embed auth.middleware.gin.hbs
17+
var GinAuthMiddleware string
18+
19+
//go:embed auth.middleware.mux.hbs
20+
var MuxAuthMiddleware string

0 commit comments

Comments
 (0)