mirror of
https://github.com/teamhanko/hanko.git
synced 2025-11-01 10:38:50 +08:00
44 lines
1015 B
Go
44 lines
1015 B
Go
/*
|
|
Copyright © 2022 Hanko GmbH <developers@hanko.io>
|
|
*/
|
|
package cmd
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/teamhanko/hanko/backend/cmd/isready"
|
|
"github.com/teamhanko/hanko/backend/cmd/jwk"
|
|
"github.com/teamhanko/hanko/backend/cmd/jwt"
|
|
"github.com/teamhanko/hanko/backend/cmd/migrate"
|
|
"github.com/teamhanko/hanko/backend/cmd/serve"
|
|
"github.com/teamhanko/hanko/backend/cmd/siwa"
|
|
"github.com/teamhanko/hanko/backend/cmd/version"
|
|
"log"
|
|
)
|
|
|
|
func NewRootCmd() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "hanko",
|
|
}
|
|
|
|
migrate.RegisterCommands(cmd)
|
|
serve.RegisterCommands(cmd)
|
|
isready.RegisterCommands(cmd)
|
|
jwk.RegisterCommands(cmd)
|
|
jwt.RegisterCommands(cmd)
|
|
version.RegisterCommands(cmd)
|
|
siwa.RegisterCommands(cmd)
|
|
|
|
return cmd
|
|
}
|
|
|
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
|
func Execute() {
|
|
cmd := NewRootCmd()
|
|
|
|
err := cmd.Execute()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|