hyper

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package hyper provides the dialog for Hyper device flow authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceAuthInitiatedMsg

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

DeviceAuthInitiatedMsg is sent when the device auth is initiated successfully.

type DeviceFlow

type DeviceFlow struct {
	State DeviceFlowState
	// contains filtered or unexported fields
}

DeviceFlow handles the Hyper device flow authentication.

func NewDeviceFlow

func NewDeviceFlow() *DeviceFlow

NewDeviceFlow creates a new device flow component.

func (*DeviceFlow) Cancel

func (d *DeviceFlow) Cancel()

Cancel cancels the device flow polling.

func (*DeviceFlow) CopyCode

func (d *DeviceFlow) CopyCode() tea.Cmd

CopyCode copies just the user code to the clipboard.

func (*DeviceFlow) CopyCodeAndOpenURL

func (d *DeviceFlow) CopyCodeAndOpenURL() tea.Cmd

CopyCodeAndOpenURL copies the user code to the clipboard and opens the URL.

func (*DeviceFlow) Cursor

func (d *DeviceFlow) Cursor() *tea.Cursor

Cursor hides the cursor.

func (*DeviceFlow) Init

func (d *DeviceFlow) Init() tea.Cmd

Init initializes the device flow by calling the device auth API and starting polling.

func (*DeviceFlow) SetWidth

func (d *DeviceFlow) SetWidth(w int)

SetWidth sets the width of the dialog.

func (*DeviceFlow) Update

func (d *DeviceFlow) Update(msg tea.Msg) (util.Model, tea.Cmd)

Update handles messages and state transitions.

func (*DeviceFlow) View

func (d *DeviceFlow) View() string

View renders the device flow dialog.

type DeviceFlowCompletedMsg

type DeviceFlowCompletedMsg struct {
	Token *oauth.Token
}

DeviceFlowCompletedMsg is sent when the device flow completes successfully.

type DeviceFlowErrorMsg

type DeviceFlowErrorMsg struct {
	Error error
}

DeviceFlowErrorMsg is sent when the device flow encounters an error.

type DeviceFlowState

type DeviceFlowState int

DeviceFlowState represents the current state of the device flow.

const (
	DeviceFlowStateDisplay DeviceFlowState = iota
	DeviceFlowStateSuccess
	DeviceFlowStateError
)

Jump to

Keyboard shortcuts

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