apiconfig

package
v0.0.0-...-0fda810 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:   "api-config",
	Short: "api-config generates JSON file for configuring the REST API",
	RunE: func(cmd *cobra.Command, args []string) error {
		storeConfig := endpoints.Config{
			RootPrefix: rootPrefix,
			Port:       port,
			Endpoints: endpoints.Endpoints{
				Probes:     probes,
				Projects:   projects,
				Scenarios:  scenarios,
				TestPlans:  testplans,
				Executions: executions,
				Admin: endpoints.Admin{
					Prefix: adminPrefix,
					Users:  users,
				},
			},
		}
		cfg, err := json.MarshalIndent(storeConfig, "", "  ")
		if err != nil {
			return err
		}
		if err := ioutil.WriteFile(file, cfg, 0600); err != nil {
			return err
		}
		return nil
	},
}

Command is used to generate the config file for the Test DB

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