Skip to content

Commit

Permalink
Fix dev experience
Browse files Browse the repository at this point in the history
  • Loading branch information
thedae committed Dec 20, 2024
1 parent bebc8c6 commit 7800437
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
14 changes: 10 additions & 4 deletions cmd/krakend-ce/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package main

import (
"context"
_ "embed"
"embed"
"log"
"os"
"os/signal"
Expand All @@ -25,8 +25,8 @@ const (
fcEnable = "FC_ENABLE"
)

//go:embed schema/schema.json
var embedSchema string
//go:embed schema
var embedSchema embed.FS

func main() {
sigs := make(chan os.Signal, 1)
Expand Down Expand Up @@ -61,9 +61,15 @@ func main() {
})
}

var rawSchema string
schema, err := embedSchema.ReadFile("schema/schema.json")
if err == nil {
rawSchema = string(schema)
}

commandsToLoad := []cmd.Command{
cmd.RunCommand,
cmd.NewCheckCmd(embedSchema),
cmd.NewCheckCmd(rawSchema),
cmd.PluginCommand,
cmd.VersionCommand,
cmd.AuditCommand,
Expand Down
3 changes: 2 additions & 1 deletion cmd/krakend-ce/schema/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.json
*.json
!empty.json
1 change: 1 addition & 0 deletions cmd/krakend-ce/schema/empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/krakendio/krakend-botdetector/v2 v2.1.0
github.com/krakendio/krakend-cel/v2 v2.0.1
github.com/krakendio/krakend-circuitbreaker/v2 v2.0.1
github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220103914-381b2214d989
github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220110949-53773d1b8040
github.com/krakendio/krakend-cors/v2 v2.1.1
github.com/krakendio/krakend-flexibleconfig/v2 v2.2.0
github.com/krakendio/krakend-gelf/v2 v2.0.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220092810-7d31ee55edde h1:N9
github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220092810-7d31ee55edde/go.mod h1:DynOF7SjLbzFdQLn+GWLziMGXd/075vjgWhKvuOEVBM=
github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220103914-381b2214d989 h1:bHG6MuvjRqrwr4bB1f+LGPlw48bnSCSPGejYOl75WYQ=
github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220103914-381b2214d989/go.mod h1:DynOF7SjLbzFdQLn+GWLziMGXd/075vjgWhKvuOEVBM=
github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220110949-53773d1b8040 h1:yRkx7BdbmsCwl4Ftsjk8xOVOP1M2D6mnTgVbnER7M84=
github.com/krakendio/krakend-cobra/v2 v2.4.3-0.20241220110949-53773d1b8040/go.mod h1:DynOF7SjLbzFdQLn+GWLziMGXd/075vjgWhKvuOEVBM=
github.com/krakendio/krakend-cors/v2 v2.1.1 h1:C+7GHwt/47pNGIuw5Ua4s+B5REIql/yqgZkYTY4QSTw=
github.com/krakendio/krakend-cors/v2 v2.1.1/go.mod h1:V8T2CmOrDm9+ZhopV17FabGAFQUss69PntQ8KZXpfUY=
github.com/krakendio/krakend-flexibleconfig/v2 v2.2.0 h1:8WjaZekJyoPQTHHjDAOJrlRv0ZWoVLVXvObyd5bj8gc=
Expand Down

0 comments on commit 7800437

Please sign in to comment.