cmdcontext

package
v3.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTtVersion

func GetTtVersion(pathToBin string) (version.Version, error)

GetTtVersion returns version of Tt provided by its executable path.

func TtVersionOutput

func TtVersionOutput(ctx context.Context, pathToBin string) ([]byte, error)

TtVersionOutput returns what the tt at pathToBin prints for version --commit.

The tt asked may be an older one, which runs the tt of the bin_dir of the tt.yaml it finds - from its working directory upward, or the system one - in its own place unless it is given --self; asked plainly, it could report the version of that other tt. So --self is passed first, and the question is asked again without it only when the tt says it knows no such flag: a tt that has none runs no other tt either.

Types

type CliCtx

type CliCtx struct {
	// Use internal module even if an external one is found.
	ForceInternal bool
	// ProjectDir is the project directory the working directory is in, as
	// internal/scope finds it, or the working directory outside a project.
	ProjectDir string
	// Path to tt daemon (tt_daemon.yaml) config.
	DaemonCfgPath string
	// TarantoolPrefix is the directory TarantoolCli is installed under, whose
	// include/tarantool holds its headers, when tt binary installed it: the
	// root of the project scope for the tarantool of the project. It is
	// empty for a tarantool from PATH.
	TarantoolPrefix string
	// Verbose logging flag. Enables debug log output.
	Verbose bool
	// TarantoolCli is current tarantool cli.
	TarantoolCli TarantoolCli
	// TcmCli is current tcm cli.
	TcmCli TcmCli
	// IntegrityCheck is a public key used for integrity check.
	IntegrityCheck string
	// IntegrityCheckPeriod is an period during which the integrity check is reproduced.
	IntegrityCheckPeriod int
	// NoPrompt flag needs to skip cli interaction using default behavior.
	NoPrompt bool
}

CliCtx - CLI context. Contains flags passed when starting Tarantool CLI and some other parameters.

type CmdCtx

type CmdCtx struct {
	// Cli - CLI context. Contains flags passed when starting
	// Tarantool CLI and some other parameters.
	Cli CliCtx
	// CommandName contains name of the command.
	CommandName string
	// Integrity contains tools used for integrity checking.
	Integrity integrity.IntegrityCtx
}

CmdCtx is the main structure of the program context. Contains within itself other structures of CLI modules.

type TarantoolCli

type TarantoolCli struct {
	// Executable is a path to Tarantool executable.
	Executable string
	// contains filtered or unexported fields
}

TarantoolCli describes tarantool executable.

func (*TarantoolCli) GetVersion

func (tntCli *TarantoolCli) GetVersion() (version.Version, error)

GetVersion returns and caches the tarantool version.

type TcmCli

type TcmCli struct {
	// Executable is a path to tcm executable.
	Executable string
}

TcmCli describes tcm executable.

Jump to

Keyboard shortcuts

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