Documentation
¶
Overview ¶
Package hyper provides the dialog for Hyper device flow authentication.
Index ¶
- type DeviceAuthInitiatedMsg
- type DeviceFlow
- func (d *DeviceFlow) Cancel()
- func (d *DeviceFlow) CopyCode() tea.Cmd
- func (d *DeviceFlow) CopyCodeAndOpenURL() tea.Cmd
- func (d *DeviceFlow) Cursor() *tea.Cursor
- func (d *DeviceFlow) Init() tea.Cmd
- func (d *DeviceFlow) SetWidth(w int)
- func (d *DeviceFlow) Update(msg tea.Msg) (util.Model, tea.Cmd)
- func (d *DeviceFlow) View() string
- type DeviceFlowCompletedMsg
- type DeviceFlowErrorMsg
- type DeviceFlowState
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) 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) 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.
type DeviceFlowCompletedMsg ¶
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 )