add MediaLofi in kontor-gin (#97)
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #97
This commit was merged in pull request #97.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"kontor-api-gin/internal/config"
|
||||
"log/slog"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var configCmd = &cobra.Command{
|
||||
Use: "config",
|
||||
TraverseChildren: true,
|
||||
Short: "show current config",
|
||||
Long: "show current config",
|
||||
// Args: cobra.ExactArgs(2),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
slog.Info("show config")
|
||||
var config config.CliConfig
|
||||
if err := viper.Unmarshal(&config); err != nil {
|
||||
slog.Info("unable to decode config", "error", err.Error())
|
||||
}
|
||||
for name, server := range config.Server {
|
||||
slog.Info("show config", "server", name, "URL", server.Url)
|
||||
}
|
||||
slog.Info("show config", "config", config)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(configCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user