Documentation ¶
Overview ¶
Package commandline is responsible for creating, parsing and validating command line arguments.
Index ¶
Constants ¶
const Bash = "bash"
const CredentialsAuth = "credentials"
const DefinitionsDirectory = "definitions"
const LoginAuth = "login"
const PatAuth = "pat"
const Powershell = "powershell"
Variables ¶
This section is empty.
Functions ¶
func PowershellProfilePath ¶ added in v1.0.3
Returns powershell profile path on linux
Types ¶
type AutoCompleteHandler ¶
type AutoCompleteHandler struct { }
AutoCompleteHandler parses the autocomplete command and provides suggestions for the available commands. It tries to perform a prefix- as well as contains-match based on the current context. Example: uipath autocomplete complete --command "uipath o" returns: oms orchestrator documentunderstanding
func (AutoCompleteHandler) EnableCompleter ¶ added in v1.0.3
func (a AutoCompleteHandler) EnableCompleter(shell string, filePath string) (string, error)
type Cli ¶
type Cli struct { StdIn io.Reader StdOut io.Writer StdErr io.Writer ColoredOutput bool DefinitionProvider DefinitionProvider ConfigProvider config.ConfigProvider Executor executor.Executor PluginExecutor executor.Executor }
Cli is a wrapper for building the CLI commands.
type CommandBuilder ¶
type CommandBuilder struct { Input []byte StdIn io.Reader StdOut io.Writer StdErr io.Writer ConfigProvider config.ConfigProvider Executor executor.Executor PluginExecutor executor.Executor DefinitionProvider DefinitionProvider }
The CommandBuilder is creating all available operations and arguments for the CLI.
func (CommandBuilder) Create ¶
func (b CommandBuilder) Create(args []string) ([]*cli.Command, error)
func (CommandBuilder) CreateDefaultFlags ¶
func (b CommandBuilder) CreateDefaultFlags(hidden bool) []cli.Flag
func (CommandBuilder) HelpFlag ¶
func (b CommandBuilder) HelpFlag() cli.Flag
type ConfigCommandHandler ¶
type ConfigCommandHandler struct { StdIn io.Reader StdOut io.Writer ConfigProvider config.ConfigProvider }
The ConfigCommandHandler implements commands for configuring the CLI. The CLI can be configured interactively or by setting config values programmatically.
Example: uipath config ==> interactive configuration of the CLI uipath config set ==> stores a value in the configuration file
type DefinitionData ¶
DefinitionData contains the name of the definition file and its data.
func NewDefinitionData ¶
func NewDefinitionData(name string, data []byte) *DefinitionData
type DefinitionProvider ¶ added in v1.0.17
type DefinitionProvider struct { DefinitionStore DefinitionStore Parser parser.Parser CommandPlugins []plugin.CommandPlugin }
The DefinitionProvider uses the store to read the definition files. It parses the definition files and also supports merging multiple files for the same service.
The following mapping is performed between the files on disk and the commands the CLI provides: orchestrator.yaml => uipath orchestrator ... du.metering.yaml => uipath du ... du.events.yaml => uipath du ...
For performance reasons, the definition provider always just loads the definition files belonging to a single service. There is no need to load the definition file for the du service when the user executes 'uipath orchestrator', for example.
func (DefinitionProvider) Index ¶ added in v1.0.17
func (p DefinitionProvider) Index() ([]parser.Definition, error)
func (DefinitionProvider) Load ¶ added in v1.0.17
func (p DefinitionProvider) Load(name string) (*parser.Definition, error)
type DefinitionStore ¶ added in v1.0.17
type DefinitionStore struct { DefinitionDirectory string DefinitionFiles []string Definitions []DefinitionData }
DefinitionStore discovers the definition files from disk searching for the definitions/ folder and returns the data for a particular definition file.
func (*DefinitionStore) Names ¶ added in v1.0.17
func (s *DefinitionStore) Names() ([]string, error)
func (*DefinitionStore) Read ¶ added in v1.0.17
func (s *DefinitionStore) Read(name string) (*DefinitionData, error)
type MultiDefinition ¶ added in v1.0.26
type MultiDefinition struct{}
MultiDefinition merges multiple definitions into a single one. This enables teams to provide fine-grained specifications for their individual micro-services and still provide them under a single command.
func (MultiDefinition) Merge ¶ added in v1.0.26
func (d MultiDefinition) Merge(name string, definitions []*parser.Definition) *parser.Definition
type TypeConverter ¶
type TypeConverter struct{}
The TypeConverter converts the string value from the command-line argument into the type the definition declared. CLI arguments are always passed as strings and need to be converted to their respective type.
type UriBuilder ¶ added in v1.0.5
type UriBuilder struct {
// contains filtered or unexported fields
}
UriBuilder merges parts of the uri so that they can be overridden from multiple sources, like environment variables, config files or command line arguments.
func NewUriBuilder ¶ added in v1.0.5
func NewUriBuilder(uri url.URL) *UriBuilder
func (*UriBuilder) OverrideUri ¶ added in v1.0.5
func (b *UriBuilder) OverrideUri(overrideUri *url.URL)
func (UriBuilder) Uri ¶ added in v1.0.5
func (b UriBuilder) Uri() url.URL