mirror of
https://github.com/luscis/openlan.git
synced 2025-10-19 15:24:35 +08:00
clone from danieldin95
This commit is contained in:
29
cmd/api/v6/cmd.go
Executable file
29
cmd/api/v6/cmd.go
Executable file
@@ -0,0 +1,29 @@
|
||||
package v6
|
||||
|
||||
import (
|
||||
"github.com/luscis/openlan/cmd/api"
|
||||
"github.com/luscis/openlan/pkg/database"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
func Before(c *cli.Context) error {
|
||||
if _, err := database.NewDBClient(nil); err == nil {
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
func After(c *cli.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Commands(app *api.App) {
|
||||
app.After = After
|
||||
app.Before = Before
|
||||
Switch{}.Commands(app)
|
||||
Network{}.Commands(app)
|
||||
Link{}.Commands(app)
|
||||
Name{}.Commands(app)
|
||||
Prefix{}.Commands(app)
|
||||
}
|
Reference in New Issue
Block a user