commands

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigsAppCompleter

func ConfigsAppCompleter(cli *client.Client, tag string) carapace.Action

ConfigsAppCompleter completes file paths to the current application configs.

func ConfigsCompleter

func ConfigsCompleter(cli *client.Client, filePath, ext, tag string, noSelf bool) carapace.CompletionCallback

ConfigsCompleter completes file paths to other teamserver application configs (clients/users CA, etc) The filepath is the directory between .app/ and the target directory where config files of a certain type should be found, ext is the normal/default extension for those target files, and tag is used in comps.

func Generate

func Generate(cli *client.Client) *cobra.Command

Generate returns a command tree to embed in client applications connecting to a teamserver. It requires only the client to use its functions.

All commands of the tree include an automatic call to client.Connect() to make sure they can reach the server for the stuff they need. Thus no pre-runners are bound to them for this purpose, and users of this command tree are free to add any.

This tree is only safe to embed within closed-loop applications provided that the client *Client was created with WithNoDisconnect(), so that commands can reuse their connections more than once before closing.

func PostRun

func PostRun(client *client.Client) command.CobraRunnerE

PostRun is a cobra command runner that simply calls client.Disconnect() to close the client connection from its teamserver. If the client/commands was configured with WithNoDisconnect, this pre-runner will do nothing.

func PreRun

func PreRun(teamclient *client.Client, opts ...client.Options) command.CobraRunnerE

PreRun returns a cobra command runner which connects the client to its teamserver. If the client is connected, nothing happens and its current connection reused.

Feel free to use this function as a model for your own teamclient pre-runners.

func PreRunNoDisconnect

func PreRunNoDisconnect(teamclient *client.Client, opts ...client.Options) command.CobraRunnerE

PreRunNoDisconnect is a pre-runner that will connect the teamclient with the client.WithNoDisconnect() option, so that after each execution, the client connection is kept open. This pre-runner is thus useful for console apps.

Feel free to use this function as a model for your own teamclient pre-runners.

Types

This section is empty.

Jump to

Keyboard shortcuts

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