Documentation
¶
Index ¶
- func BuildDuoCLIEnv() []string
- type BinaryInfo
- type BinaryManager
- func (m *BinaryManager) CheckForUpdate(ctx context.Context, currentVersion string, lastCheckTime time.Time, ...) (bool, string, time.Time, error)
- func (m *BinaryManager) EnsureInstalled(ctx context.Context, installedVersion, installedPath string, ...) (*BinaryInfo, error)
- func (m *BinaryManager) Update(ctx context.Context) (*BinaryInfo, error)
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 ¶
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.