config

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckConfigCmd = &cobra.Command{
	Use:   "check",
	Short: "Check Goma Gateway configuration file",
	Run: func(cmd *cobra.Command, args []string) {
		configFile, _ := cmd.Flags().GetString("config")
		if configFile == "" {
			fmt.Println("no config file specified")
			os.Exit(1)
		}
		err := internal.CheckConfig(configFile)
		if err != nil {
			fmt.Printf(" Error checking config file: %s\n", err)
			os.Exit(1)
		}
		fmt.Println("Goma Gateway configuration file checked successfully")

	},
}
View Source
var Cmd = &cobra.Command{
	Use:   "config",
	Short: "Goma Gateway configuration management",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			return
		} else {
			fmt.Printf("config accepts no argument %q\n", args)
			os.Exit(1)
		}

	},
}
View Source
var InitConfigCmd = &cobra.Command{
	Use:   "init",
	Short: "Initialize Goma Gateway configuration file",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			force, _ := cmd.Flags().GetBool("force")
			configFile, _ := cmd.Flags().GetString("output")
			if configFile == "" {
				fmt.Println("Error: no config file specified")
				os.Exit(1)
			}

			if _, err := os.Stat(configFile); !os.IsNotExist(err) {
				if !force {
					fmt.Printf("%s config file already exists, use -f to overwrite\n", configFile)
					os.Exit(1)
				}
			}
			err := internal.InitConfig(configFile)
			if err != nil {
				fmt.Println(err)
				os.Exit(1)
			}
			fmt.Println("configuration file has been initialized successfully")
		} else {
			fmt.Printf("config accepts no argument %q\n", args)
			os.Exit(1)
		}

	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL