client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Command = &cobra.Command{
		Use:   "client",
		Short: "Interactive terminal for communicating with the server",

		Run: func(cmd *cobra.Command, args []string) {
			log := viper.Get("logger").(zerolog.Logger)
			output := viper.GetString("fossil.output")
			if len(filterStringSlice([]string{"csv", "text", "json"}, output)) != 1 {
				log.Fatal().Msg("unsupported output format")
			}

			host := viper.GetString("fossil.host")
			target, err := proto.ParseConnectionString(host)
			if err != nil {
				log.Fatal().Err(err).Msg("error parsing URL")
			}

			client, err := fossil.NewClient(host)
			if err != nil {
				log.Error().Err(err).Str("address", target.Address).Msg("unable to connect to server")
			}

			readlinePrompt(client, output)
		},
	}
)

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