client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package client contains a client for RUN-DSP, this is the base of all client subcommands.

Index

Constants

This section is empty.

Variables

View Source
var (
	Command = &cobra.Command{
		Use:   "client",
		Short: "Run a RUN-DSP client command.",
		Long:  `Run a RUN-DSP client command.`,
		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
			if err := cfg.CheckConnectAddr(viper.GetString(shared.Address)); err != nil {
				return err
			}

			if !viper.GetBool(shared.InsecureConn) {
				if err := cfg.CheckFilesExist(viper.GetString(shared.CACert)); err != nil {
					return err
				}
				if viper.GetString(shared.ClientCert) != "" && viper.GetString(shared.ClientCertKey) != "" {
					if err := cfg.CheckFilesExist(
						viper.GetString(shared.ClientCert),
						viper.GetString(shared.ClientCertKey),
					); err != nil {
						return err
					}
				}
			}

			o, err := os.Stdout.Stat()
			if err != nil {
				return fmt.Errorf("could not stat stdout: %w", err)
			}

			isTerminal := o.Mode()&os.ModeCharDevice == os.ModeCharDevice

			if noColour || !isTerminal {
				color.NoColor = true
				viper.Set(shared.NoColor, true)
			}

			return nil
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
Package authinjector contains a helper injector that injects an argument in the metadata.
Package authinjector contains a helper injector that injects an argument in the metadata.
Package downloaddataset offers a command to download a dataset.
Package downloaddataset offers a command to download a dataset.
Package getcatalog gets a catalog from the requested dataspace provider.
Package getcatalog gets a catalog from the requested dataspace provider.
Package getdataset offers a command to get the information of specific dataset.
Package getdataset offers a command to get the information of specific dataset.
Package shared contains shared constants for the client and all its subcommands.
Package shared contains shared constants for the client and all its subcommands.

Jump to

Keyboard shortcuts

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