blackfire

package
v0.2.19-beta Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use: "blackfire [command]",
	Short: fmt.Sprintf(
		"Interacts with the blackfire service on an environment (disabled if %v_BLACKFIRE is not 1)",
		strings.ToUpper(core.AppName)),
	Long: fmt.Sprintf(
		`Interacts with the blackfire service on an environment (disabled if %v_BLACKFIRE is not 1)`,
		strings.ToUpper(core.AppName)),
	ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
		return nil, cobra.ShellCompDirectiveNoFileComp
	},
	PreRunE: func(cmd *cobra.Command, args []string) error {
		if err := core.CheckDocker(); err != nil {
			return err
		}

		if err := commands.EnvCheck(); err != nil {
			return err
		}

		isContainerRunning, err := core.IsContainerRunning(core.GetBlackfireContainer())
		if err != nil {
			return err
		}
		if !core.IsDBEnabled() || !isContainerRunning {
			return core.CannotFindContainerError(core.GetBlackfireContainer())
		}

		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		return commands.BlackfireCmd(cmd, args)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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