command

package
v0.0.0-...-fd0b357 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const LibcExec = "libc-exe"
View Source
const SitePackagesName = "site-packages.zip"

Variables

View Source
var FlywheelUserHome, ConfigPath, CachePath string
View Source
var PythonCliCommand = []string{"-I", "-m", "flywheel_cli.main"}
View Source
var UserAgent = ""

Functions

func AddDelegateCommand

func AddDelegateCommand(parent *cobra.Command, command, description string) *cobra.Command

Add a command to parent that will be delegated to python

func BuildCommand

func BuildCommand(version, buildHash, buildDate string) *cobra.Command

func DelegateCommandToPython

func DelegateCommandToPython(command *cobra.Command, args []string)

Exits if the command is delegated

func DeleteCreds

func DeleteCreds() error

func ExtractAssetZip

func ExtractAssetZip(assetName, destDir string) error

Extract a go-bindata encoded asset zipfile to destDir

func MakeClient

func MakeClient() (*api.Client, error)

MakeClient attempts to create an SDK client using LoadCreds.

func MakeClientWithCreds

func MakeClientWithCreds(key string, insecure bool) (*api.Client, error)

func SetupCloseHandler

func SetupCloseHandler()

SetupCloseHandler creates a 'listener' on a new goroutine which will notify the program if it receives an interrupt from the OS. We need this because the ingest handles the first SIGTERM, but does not force exit all workers - however the 2nd SIGTERM would not reach python if we exit the GO program - this way the python might not exit

Types

type CommandDesc

type CommandDesc struct {
	Command     string
	Description string
}

type Creds

type Creds struct {
	Key      string `json:"key"`
	Insecure bool   `json:"insecure"`
}

Creds represents the state that is stored in the user's homedir, at ConfigPath.

func LoadCreds

func LoadCreds() (*Creds, error)

LoadCreds attempts to load an existing config file from ConfigPath.

func (*Creds) Save

func (c *Creds) Save()

Save persists the Creds to ConfigPath. Exits on error.

type PkgVersionInfo

type PkgVersionInfo struct {
	PythonVersion string `json:"python_version",omitempty`
	PyVer         string `json:"py_ver",omitempty`
	BuildTime     string `json:"build_time",omitempty`
}

type PythonPathInfo

type PythonPathInfo struct {
	PythonBinDir    string
	SitePackagePath string
}

func PopulateCache

func PopulateCache(cacheDir string) (*PythonPathInfo, error)

Extract the python interpreter and site-packages.zip to the cache directory

Jump to

Keyboard shortcuts

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