client

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: BSD-2-Clause Imports: 16 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)

			host := viper.GetString("fossil.host")
			target := proto.ParseConnectionString(host)

			if target.Local {
				db, err := database.NewDatabase(log, target.Database, target.Database)
				if err != nil {
					log.Fatal().Err(err).Msg("error creating new database")
				}

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

				readlinePrompt(client)
			}
		},
	}
)

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