plugin

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "plugin",
	Short: "Issue command to plugin control",
}

Cmd is the declaration of the command line

View Source
var ListDriversCmd = &cobra.Command{
	Use:   "list-drivers",
	Short: "Get info about a collection",
	RunE: func(cmd *cobra.Command, args []string) error {
		conn, err := gripql.Connect(rpc.ConfigWithDefaults(host), true)
		if err != nil {
			return err
		}
		conn = conn.WithConfigureAPI()
		lst, err := conn.ListDrivers()
		if err == nil {
			for _, l := range lst.Drivers {
				fmt.Printf("%s\n", l)
			}
		} else {
			log.Error(err)
		}
		return err
	},
}
View Source
var ListPluginsCmd = &cobra.Command{
	Use:   "list-plugins",
	Short: "Get info about a collection",
	RunE: func(cmd *cobra.Command, args []string) error {
		conn, err := gripql.Connect(rpc.ConfigWithDefaults(host), true)
		if err != nil {
			return err
		}
		conn = conn.WithConfigureAPI()
		lst, err := conn.ListPlugins()
		if err == nil {
			for _, l := range lst.Plugins {
				fmt.Printf("%s\n", l)
			}
		} else {
			log.Error(err)
		}
		return err
	},
}
View Source
var StartPluginCmd = &cobra.Command{
	Use:   "start",
	Short: "Start a plugin driver",
	Args:  cobra.ExactArgs(2),
	RunE: func(cmd *cobra.Command, args []string) error {
		driver := args[0]
		name := args[1]
		conn, err := gripql.Connect(rpc.ConfigWithDefaults(host), true)
		if err != nil {
			return err
		}
		conn = conn.WithConfigureAPI()
		_, err = conn.StartPlugin(&gripql.PluginConfig{Driver: driver, Name: name, Config: startConfig})
		return err
	},
}

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