Documentation
¶
Index ¶
- Constants
- func Boot(opts BootOptions) (*cobra.Command, error)
- func BuiltinCommands() []*cobra.Command
- func Configure() error
- func ConfigureHelp(external []ExternalCommand)
- func GetCmdCtxPtr() *cmdcontext.CmdCtx
- func LoadApp(ctx context.Context, appName string, lookup sdk.AppLookup) (*app.App, error)
- func NewBackupCmd() *cobra.Command
- func NewBackupIDCmd() *cobra.Command
- func NewBinaryCmd() *cobra.Command
- func NewCatCmd() *cobra.Command
- func NewCheckCmd() *cobra.Command
- func NewCleanCmd() *cobra.Command
- func NewClusterCmd() *cobra.Command
- func NewClusterTopologyCmd() *cobra.Command
- func NewCompletionCmd() *cobra.Command
- func NewConnectCmd() *cobra.Command
- func NewCoredumpCmd() *cobra.Command
- func NewCreateCmd() *cobra.Command
- func NewDaemonCmd() *cobra.Command
- func NewErrorsHelpTopic() *cobra.Command
- func NewInstanceCmd() *cobra.Command
- func NewKillCmd() *cobra.Command
- func NewLogrotateCmd() *cobra.Command
- func NewLogsCmd() *cobra.Command
- func NewNewCmd() *cobra.Command
- func NewPackageCmd() *cobra.Command
- func NewPlayCmd() *cobra.Command
- func NewRegistryCmd() *cobra.Command
- func NewReplicasetCmd() *cobra.Command
- func NewRestartCmd() *cobra.Command
- func NewRestoreCmd() *cobra.Command
- func NewRocksCmd() *cobra.Command
- func NewRunCmd() *cobra.Command
- func NewServiceCmd() *cobra.Command
- func NewStartCmd() *cobra.Command
- func NewStatusCmd() *cobra.Command
- func NewStopCmd() *cobra.Command
- func NewTcmCmd() *cobra.Command
- func NewTestCmd() *cobra.Command
- func NewVersionCmd() *cobra.Command
- func ProjectDir() (string, error)
- func Run() int
- type BootOptions
- type ExternalCommand
Constants ¶
const LegacyAnnotation = "tt.core/legacy"
LegacyAnnotation is the key of the command annotation that marks a top-level command built by this package - a builtin - rather than contributed by a module. Its value is "true".
Variables ¶
This section is empty.
Functions ¶
func Boot ¶
func Boot(opts BootOptions) (*cobra.Command, error)
Boot creates the root command - the global flags, no subcommands - and makes it the process's root. It parses the global flags in opts.Args and installs the process logger they ask for. The root and the commands built after Boot present tt as opts.Flavour and have the integrity flags of opts.Integrity, the provider of the process from then on.
A flag error is not returned: Run reports it, once the logger is set up. An invalid --log-format leaves the default format in place until then.
func BuiltinCommands ¶
BuiltinCommands returns new instances of tt's top-level commands, each annotated with LegacyAnnotation.
func Configure ¶
func Configure() error
Configure configures tt for the command line Boot parsed: it finds the project and the executables the commands run, and sets up the integrity checks. No configuration file of tt is read: tt.yaml is gone.
func ConfigureHelp ¶
func ConfigureHelp(external []ExternalCommand)
ConfigureHelp sets up the help of the tree: the help command, which completes the names of the top-level commands, and the help templates. The root help lists external under EXTERNAL COMMANDS. The command tree must be complete.
func GetCmdCtxPtr ¶
func GetCmdCtxPtr() *cmdcontext.CmdCtx
GetCmdCtxPtr returns a pointer to the context of the process, for the core to offer its services from.
func LoadApp ¶
LoadApp loads the application appName and its pair as the instance commands do, for the core: the project search starts in the directory the commands work in, the application is looked for and its pair chosen as lookup says, as --scope and --template of an instance command, and the files are read through the integrity checks.
func NewBackupCmd ¶
NewBackupCmd creates the parent `tt backup` command.
func NewBinaryCmd ¶
NewBinaryCmd creates the command for managing binaries and SDK installations.
func NewCheckCmd ¶
NewCheckCmd creates the check command of tt instance.
func NewCleanCmd ¶
NewCleanCmd creates the clean command of tt instance.
func NewClusterCmd ¶
func NewClusterTopologyCmd ¶
NewClusterTopologyCmd creates the command that shows the current cluster topology.
func NewCompletionCmd ¶
NewCompletionCmd creates a new completion command.
func NewConnectCmd ¶
NewConnectCmd creates tt connect, the documented facade of tt instance connect: the same command, with the same flags, which has no behaviour of its own.
func NewCreateCmd ¶
NewCreateCmd creates an application from a template.
func NewErrorsHelpTopic ¶
NewErrorsHelpTopic creates the errors help topic, which explains the exit codes of tt commands. It has no Run, which is what makes it a help topic rather than a command: tt help errors prints it, and the command list leaves it out.
func NewInstanceCmd ¶
NewInstanceCmd creates the tt instance group: the commands that act on the processes of the instances of an application on this host.
func NewKillCmd ¶
NewKillCmd creates the kill command of tt instance.
func NewLogrotateCmd ¶
NewLogrotateCmd creates the logrotate command of tt instance.
func NewLogsCmd ¶
NewLogsCmd creates the logs command of tt instance.
func NewNewCmd ¶
NewNewCmd creates `tt new`: the skeleton app.manifest.toml a package starts from.
It is a top-level command rather than a `tt package` subcommand because it is what runs before a package exists — every `tt package` command reads the file this one writes.
func NewPackageCmd ¶
NewPackageCmd creates the `tt package` command group: the manifest build pipeline (build, fetch and pack), the dependency-changing commands (add, remove and update), installation, and the inventory over what is installed (list and uninstall).
func NewRegistryCmd ¶
NewRegistryCmd creates the `tt registry` command group: the rock servers the package commands resolve against.
func NewReplicasetCmd ¶
NewReplicasetCmd creates a replicaset command.
func NewRestartCmd ¶
NewRestartCmd creates the restart command of tt instance.
func NewRestoreCmd ¶
NewRestoreCmd creates the parent `tt restore` command.
func NewRunCmd ¶
NewRunCmd creates `tt run`: the project's Tarantool, with the arguments passed straight through.
func NewServiceCmd ¶
NewServiceCmd creates the tt service group: what ties the instances of applications to the service manager of the system.
func NewStartCmd ¶
NewStartCmd creates the start command of tt instance.
func NewStatusCmd ¶
NewStatusCmd creates the status command of tt instance.
func NewStopCmd ¶
NewStopCmd creates the stop command of tt instance.
func NewTestCmd ¶
NewTestCmd creates `tt test`: build the package, then run its test suite under the same Tarantool tt run would choose.
func NewVersionCmd ¶
NewVersionCmd creates a new version command.
func ProjectDir ¶
ProjectDir returns the directory project commands work on, as an absolute path: the -C directory when one was given, and the working directory otherwise.
Types ¶
type BootOptions ¶
type BootOptions struct {
// Args are the command-line arguments, without the program name.
Args []string
// Flavour is how the distribution of tt presents itself. The zero
// Flavour is tt's own.
Flavour version.Flavour
// Integrity is the integrity provider tt runs with: it registers the
// integrity flags, checks the files and signs and verifies the data of
// a configuration storage. Nil is the disabled provider, which checks
// nothing and registers no flag.
Integrity integrity.Provider
// Modules are the modules the distribution is built from, as the table
// of the core names them, for tt version --modules.
Modules []version.Module
}
BootOptions configure Boot.
type ExternalCommand ¶
type ExternalCommand struct {
// Name is the command's name.
Name string
// Help is the module's one-line description.
Help string
}
ExternalCommand is a top-level command that runs an external module, as the root help lists it under EXTERNAL COMMANDS.
Source Files
¶
- backup.go
- binary.go
- binary_build.go
- boot.go
- cat.go
- check.go
- clean.go
- cluster.go
- common.go
- completion.go
- connect.go
- coredump.go
- create.go
- daemon.go
- foreground.go
- help.go
- help_errors.go
- instance.go
- instances.go
- integrity.go
- kill.go
- logrotate.go
- logs.go
- managed.go
- new.go
- output.go
- package.go
- play.go
- projectdir.go
- registry.go
- replicaset.go
- restart.go
- restore.go
- restore_layout.go
- rocks.go
- root.go
- run.go
- service.go
- start.go
- status.go
- stop.go
- tcm.go
- test.go
- topology.go
- version.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package clidoc renders the command reference of tt as Markdown pages from the command tree tt runs: a page for every top-level command, with its subcommands under it, a page for every help topic, and an index of them.
|
Package clidoc renders the command reference of tt as Markdown pages from the command tree tt runs: a page for every top-level command, with its subcommands under it, a page for every help topic, and an index of them. |
|
Package helpgolden renders what tt prints for help and completion, for tests that pin it against a golden file: the --help of every command, the bash completion script and the completions of the first word.
|
Package helpgolden renders what tt prints for help and completion, for tests that pin it against a golden file: the --help of every command, the bash completion script and the completions of the first word. |