cliutils

package
v1.87.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDuoCLIEnv

func BuildDuoCLIEnv() []string

BuildDuoCLIEnv builds the environment variables for the Duo CLI process. This allows the Duo CLI team to track usage sources via GITLAB_DUO_DISTRIBUTION.

Types

type BinaryInfo

type BinaryInfo struct {
	Path     string
	Version  string
	Checksum string
}

BinaryInfo represents metadata about the installed Duo CLI binary.

type BinaryManager

type BinaryManager struct {
	// contains filtered or unexported fields
}

BinaryManager handles the lifecycle of the Duo CLI binary.

func NewBinaryManager

func NewBinaryManager(io *iostreams.IOStreams) *BinaryManager

NewBinaryManager creates a new BinaryManager instance.

func (*BinaryManager) CheckForUpdate

func (m *BinaryManager) CheckForUpdate(ctx context.Context, currentVersion string, lastCheckTime time.Time, forceCheck bool) (bool, string, time.Time, error)

CheckForUpdate checks if a newer version of Duo CLI is available. Returns (hasUpdate, latestVersion, newCheckTime, error). Caller should save newCheckTime to config if non-zero.

func (*BinaryManager) EnsureInstalled

func (m *BinaryManager) EnsureInstalled(ctx context.Context, installedVersion, installedPath string, autoDownload string) (*BinaryInfo, error)

EnsureInstalled ensures the Duo CLI binary is installed and returns metadata. If the binary is not installed, it prompts the user and downloads it. The caller should check if binaryPath matches expectedPath and if binary is valid.

func (*BinaryManager) Update

func (m *BinaryManager) Update(ctx context.Context) (*BinaryInfo, error)

update downloads and installs the latest version of Duo CLI. Returns BinaryInfo for caller to save to config.

Jump to

Keyboard shortcuts

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