cmd

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2017 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverCommandDescription = "Manage drivers: install, remove and list"
	DriverCommandHelp        = DriverCommandDescription
)
View Source
const (
	DriverInstallCommandDescription = "Installs a new driver for a given language"
	DriverInstallCommandHelp        = DriverInstallCommandDescription + "\n\n" +
		"Using `--all` all the official bblfsh driver are install in the \n" +
		"daemon. Using `--language` and `--image` arguments one single driver \n" +
		"can be installed or updated.\n\n" +
		"Image reference format should be `[transport]name[:tag]`.\n" +
		"Defaults are 'docker://' for transport and 'latest' for tag."
)
View Source
const (
	DriverListCommandDescription = "List the installed drivers for each language"
	DriverListCommandHelp        = DriverListCommandDescription
)
View Source
const (
	DriverRemoveCommandDescription = "Removes a new driver for the given language"
	DriverRemoveCommandHelp        = DriverRemoveCommandDescription
)
View Source
const (
	InstancesCommandDescription = "List the driver instances running on the daemon"
	InstancesCommandHelp        = InstancesCommandDescription
)
View Source
const (
	ParseCommandDescription = "Parse a file and prints the UAST or AST"
	ParseCommandHelp        = ParseCommandDescription
)
View Source
const (
	StatusCommandDescription = "List all the pools of driver instances running"
	StatusCommandHelp        = StatusCommandDescription + "\n\n" +
		"The drivers are started on-demand based on the load of the server, \n" +
		"this driver instances are organized in pools by language.\n\n" +
		"This command prints a list of the pools running on the daemon, with \n" +
		"the number of requests success and failed, the number of instances \n" +
		"current and desired, the number of request waiting to be handle and \n" +
		"the drivers existed with with a non-zero code."
)

Variables

View Source
var (
	// DefaultTransport is the default transport used when is missing on the
	// image reference.
	DefaultTransport = "docker://"
	// OfficialDriver represents the list of all the official bblfsh drivers.
	OfficialDriver = map[string]string{
		"python": "docker://bblfsh/python-driver:latest",
		"java":   "docker://bblfsh/java-driver:latest",
	}

	SupportedTransports = map[string]bool{
		"docker":        true,
		"docker-daemon": true,
	}
)

Functions

This section is empty.

Types

type ControlCommand

type ControlCommand struct {
	Network string `long:"ctl-endpoint" default:"unix" description:"control server network type"`
	Address string `long:"ctl-address" default:"/var/run/bblfshctl.sock" description:"control server address to connect"`
	// contains filtered or unexported fields
}

func (*ControlCommand) Execute

func (c *ControlCommand) Execute(args []string) error

type DriverCommand

type DriverCommand struct {
	ControlCommand
}

func (*DriverCommand) Execute

func (*DriverCommand) Execute([]string) error

type DriverInstallCommand

type DriverInstallCommand struct {
	Args struct {
		Language       string `positional-arg-name:"language" description:"language supported by the driver"`
		ImageReference string `positional-arg-name:"image" description:"driver's image reference"`
	} `positional-args:"yes"`

	Update bool `long:"update" description:"replace the current image for the language if any"`
	All    bool `long:"all" description:"installs all the official drivers"`

	DriverCommand
}

func (*DriverInstallCommand) Execute

func (c *DriverInstallCommand) Execute(args []string) error

func (*DriverInstallCommand) Validate

func (c *DriverInstallCommand) Validate() error

type DriverListCommand

type DriverListCommand struct {
	DriverCommand
}

func (*DriverListCommand) Execute

func (c *DriverListCommand) Execute(args []string) error

type DriverRemoveCommand

type DriverRemoveCommand struct {
	Args struct {
		Language string `positional-arg-name:"language" description:"language supported by the driver"`
	} `positional-args:"yes"`

	DriverCommand
}

func (*DriverRemoveCommand) Execute

func (c *DriverRemoveCommand) Execute(args []string) error

type InstancesCommand

type InstancesCommand struct {
	ControlCommand
}

func (*InstancesCommand) Execute

func (c *InstancesCommand) Execute(args []string) error

type ParseCommand

type ParseCommand struct {
	Args struct {
		File string `positional-arg-name:"filename" description:"file to parse"`
	} `positional-args:"yes"`

	Native bool `long:"native" description:"if native, the native AST will be returned"`
	UserCommand
}

func (*ParseCommand) Execute

func (c *ParseCommand) Execute(args []string) error

type StatusCommand

type StatusCommand struct {
	ControlCommand
}

func (*StatusCommand) Execute

func (c *StatusCommand) Execute(args []string) error

type UserCommand

type UserCommand struct {
	Network string `long:"endpoint" default:"tcp" description:"server network type"`
	Address string `long:"address" default:"localhost:9432" description:"server address to connect"`
	// contains filtered or unexported fields
}

func (*UserCommand) Execute

func (c *UserCommand) Execute(args []string) error

Jump to

Keyboard shortcuts

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