Skip to content

Commit

Permalink
Adding entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
safaci2000 committed Nov 14, 2023
1 parent 94754c9 commit 75bfc2e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
bin
vendor
.history
gdg
importer.yml
dist/
prod/
Expand Down
30 changes: 30 additions & 0 deletions cmd/gdg/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package main

import (
_ "embed"
"github.com/esnet/gdg/cli"
"github.com/esnet/gdg/cli/support"
"log"
"os"

api "github.com/esnet/gdg/internal/service"
)

var (
getGrafanaSvc = func() api.GrafanaService {
return api.NewApiService()
}
)

func main() {
setGrafanaSvc := func() support.RootOption {
return func(response *support.RootCommand) {
response.GrafanaSvc = getGrafanaSvc
}
}

err := cli.Execute("importer-example.yml", os.Args[1:], setGrafanaSvc())
if err != nil {
log.Fatalf("Error: %s", err)
}
}

0 comments on commit 75bfc2e

Please sign in to comment.