swab

package
v1.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "swab [device ID]",
	Short: "Refreshes the database/ui of a pi",
	Long:  "Forces a replication of the couch database, and causes the ui to refresh shortly after",
	Args:  args.ValidDeviceID,
	Run: func(cmd *cobra.Command, arg []string) {
		fmt.Printf("Swabbing %s\n", arg[0])

		db, _, err := args.GetDB()
		if err != nil {
			fmt.Printf("unable to get database: %v", err)
			os.Exit(1)
		}

		device, err := db.GetDevice(arg[0])
		if err != nil {
			fmt.Printf("unable to get device from database: %s\n", err)
			os.Exit(1)
		}

		err = swab(context.TODO(), device.Address)
		if err != nil {
			fmt.Printf("unable to swab %s: %s\n", device.ID, err)
			os.Exit(1)
		}

		fmt.Printf("Successfully swabbed %s\n", device.ID)
	},
}

Cmd .

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