export

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OutputLocationKey       = "output"
	OutputLocationShorthand = "o"
	OutputTypeKey           = "output-type"
	OutputTypeDefault       = OutputTypeSingleFile
	OutputTypeSingleFile    = "single-file"
	OutputTypeDirectory     = "dir"
)

Variables

View Source
var ExportCmd = &cobra.Command{
	Use:   "export",
	Short: "Export Otterize intents from network mapper",
	Args:  cobra.NoArgs,
	RunE: func(cmd *cobra.Command, args []string) error {
		return mapperclient.WithClient(func(c *mapperclient.Client) error {
			if err := validateOutputFlags(); err != nil {
				return err
			}

			intents, err := mappershared.QueryIntents()
			if err != nil {
				return err
			}
			excludedServices := viper.GetStringSlice(mapperclient.MapperExcludeServices)
			if len(excludedServices) != 0 {
				intents = mappershared.RemoveExcludedServices(intents, excludedServices)
			}

			if err := exportIntents(intents); err != nil {
				return err
			}

			return nil
		})
	},
}

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