views

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 43 Imported by: 0

Documentation

Overview

Package views implements the view layer for the gcon TUI. All views implement the View interface for consistent context propagation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstancesLoadedMsgForTest added in v0.7.0

func InstancesLoadedMsgForTest(instances []gcp.Instance) instancesLoadedMsg

InstancesLoadedMsgForTest creates an instancesLoadedMsg for cross-package testing.

func ObjectsLoadedMsgForTest

func ObjectsLoadedMsgForTest(objects []gcp.StorageObject, nextToken string, hasMore bool) objectsLoadedMsg

ObjectsLoadedMsgForTest creates an objectsLoadedMsg for testing

Types

type AddIAMBindingMsg

type AddIAMBindingMsg struct {
	ProjectID      string
	Role           string
	ConditionTitle string
	Member         string
}

AddIAMBindingMsg requests adding a member to a role binding. ConditionTitle targets the specific binding when duplicate roles exist with different conditions.

type BucketCreateCanceledMsg

type BucketCreateCanceledMsg struct{}

BucketCreateCanceledMsg indicates user canceled bucket creation

type BucketCreateRequestMsg

type BucketCreateRequestMsg struct {
	ProjectID string
}

BucketCreateRequestMsg requests opening the bucket create view

type BucketCreateView

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

BucketCreateView allows creating new GCS buckets

func NewBucketCreateView

func NewBucketCreateView(projectID string, storageClient *gcp.StorageClient) *BucketCreateView

NewBucketCreateView creates a new bucket create view

func (*BucketCreateView) GetStorageClient

func (v *BucketCreateView) GetStorageClient() *gcp.StorageClient

GetStorageClient returns the storage client

func (*BucketCreateView) HasTextInputFocused

func (v *BucketCreateView) HasTextInputFocused() bool

HasTextInputFocused returns true if a text input field is focused

func (*BucketCreateView) Init

func (v *BucketCreateView) Init() tea.Cmd

Init initializes the view

func (*BucketCreateView) SetContext

func (v *BucketCreateView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*BucketCreateView) Update

func (v *BucketCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages

func (*BucketCreateView) View

func (v *BucketCreateView) View() string

View renders the view

type BucketCreatedMsg

type BucketCreatedMsg struct {
	BucketName string
}

BucketCreatedMsg indicates successful bucket creation

type BucketSelectedMsg

type BucketSelectedMsg struct {
	Bucket gcp.Bucket
}

BucketSelectedMsg is sent when a bucket is selected (exported for app.go)

type BucketsView

type BucketsView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

BucketsView displays and manages Cloud Storage buckets in a table format

func NewBucketsView

func NewBucketsView(projectID string) *BucketsView

NewBucketsView creates a new buckets view with table display

func (*BucketsView) Close

func (v *BucketsView) Close() error

Close cleans up resources held by the view

func (*BucketsView) GetStorageClient

func (v *BucketsView) GetStorageClient() *gcp.StorageClient

GetStorageClient returns the storage client for reuse in objects view

func (*BucketsView) HasTextInputFocused

func (v *BucketsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*BucketsView) Init

func (v *BucketsView) Init() tea.Cmd

Init initializes the view and starts loading buckets

func (*BucketsView) SetContext

func (v *BucketsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*BucketsView) Update

func (v *BucketsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the buckets view

func (*BucketsView) View

func (v *BucketsView) View() string

View renders the buckets view

type CloudRunCreateRequestMsg

type CloudRunCreateRequestMsg struct {
	ProjectID string
}

CloudRunCreateRequestMsg requests opening the create view for a new service

type CloudRunEditCanceledMsg

type CloudRunEditCanceledMsg struct{}

CloudRunEditCanceledMsg indicates user canceled editing/creating

type CloudRunEditRequestMsg

type CloudRunEditRequestMsg struct {
	ProjectID   string
	ServiceName string
	FullName    string
}

CloudRunEditRequestMsg requests opening the edit view for an existing service

type CloudRunEditResultMsg

type CloudRunEditResultMsg struct {
	Name    string
	Action  string // "edit" or "create"
	Success bool
	Error   error
}

CloudRunEditResultMsg is the outcome of an edit/create operation

type CloudRunEditView

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

CloudRunEditView handles editing an existing or creating a new Cloud Run service.

func NewCloudRunEditView

func NewCloudRunEditView(projectID, serviceName, fullName string, runClient *gcp.CloudRunClient, isCreate bool) *CloudRunEditView

NewCloudRunEditView creates a new Cloud Run edit/create view.

func (*CloudRunEditView) HasTextInputFocused

func (v *CloudRunEditView) HasTextInputFocused() bool

HasTextInputFocused returns true if a text input is active.

func (*CloudRunEditView) Init

func (v *CloudRunEditView) Init() tea.Cmd

Init starts loading (edit mode) or initializes the form (create mode).

func (*CloudRunEditView) IsCreate

func (v *CloudRunEditView) IsCreate() bool

IsCreate returns true if this is a create (not edit) view.

func (*CloudRunEditView) SetContext

func (v *CloudRunEditView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*CloudRunEditView) SetError

func (v *CloudRunEditView) SetError(err error)

SetError allows the app to propagate async errors back to the view.

func (*CloudRunEditView) Update

func (v *CloudRunEditView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the edit view.

func (*CloudRunEditView) View

func (v *CloudRunEditView) View() string

View renders the edit view.

type CloudRunServiceActionResultMsg

type CloudRunServiceActionResultMsg struct {
	Name    string
	Action  string // "delete", "update_traffic"
	Success bool
	Error   error
}

CloudRunServiceActionResultMsg reports the result of an async Cloud Run operation

type CloudRunServiceDetailsView

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

CloudRunServiceDetailsView shows comprehensive service information with tabs

func NewCloudRunServiceDetailsView

func NewCloudRunServiceDetailsView(projectID, serviceName, fullName string, runClient *gcp.CloudRunClient, gcpClient *gcp.Client) *CloudRunServiceDetailsView

NewCloudRunServiceDetailsView creates a new Cloud Run service details view

func (*CloudRunServiceDetailsView) Close

func (v *CloudRunServiceDetailsView) Close()

Close releases resources associated with the view. Must be called before nil-ing the view to prevent goroutine/ticker leaks.

func (*CloudRunServiceDetailsView) GetCloudRunClient

func (v *CloudRunServiceDetailsView) GetCloudRunClient() *gcp.CloudRunClient

GetCloudRunClient returns the Cloud Run client for reuse

func (*CloudRunServiceDetailsView) GetRegions

func (v *CloudRunServiceDetailsView) GetRegions() []mouse.Region

GetRegions returns the current clickable regions

func (*CloudRunServiceDetailsView) GetServiceName

func (v *CloudRunServiceDetailsView) GetServiceName() string

GetServiceName returns the service name for breadcrumbs

func (*CloudRunServiceDetailsView) HandleRegionClick

func (v *CloudRunServiceDetailsView) HandleRegionClick(regionID string) tea.Cmd

HandleRegionClick processes a click on a specific region

func (*CloudRunServiceDetailsView) HasTextInputFocused

func (v *CloudRunServiceDetailsView) HasTextInputFocused() bool

HasTextInputFocused returns true when text input in delete confirm or traffic dialog is active

func (*CloudRunServiceDetailsView) Init

Init starts loading all datasets in parallel

func (*CloudRunServiceDetailsView) IsMenuOpen

func (v *CloudRunServiceDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu, delete confirm, or traffic dialog is open

func (*CloudRunServiceDetailsView) SetContext

SetContext updates the view with shared program context

func (*CloudRunServiceDetailsView) SetError

func (v *CloudRunServiceDetailsView) SetError(err error)

SetError allows the app to propagate async errors back to the view

func (*CloudRunServiceDetailsView) Update

func (v *CloudRunServiceDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the Cloud Run service details view

func (*CloudRunServiceDetailsView) UpdateRegions

func (v *CloudRunServiceDetailsView) UpdateRegions(offsetX, offsetY int)

UpdateRegions calculates clickable regions for tabs and viewport

func (*CloudRunServiceDetailsView) View

View renders the Cloud Run service details view

type CloudRunServiceSelectedMsg

type CloudRunServiceSelectedMsg struct {
	Service gcp.CloudRunService
}

CloudRunServiceSelectedMsg is sent when a Cloud Run service is selected from the list

type CloudRunServicesView

type CloudRunServicesView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

CloudRunServicesView displays Cloud Run services in a table

func NewCloudRunServicesView

func NewCloudRunServicesView(projectID string) *CloudRunServicesView

NewCloudRunServicesView creates a new Cloud Run services list view

func (*CloudRunServicesView) GetCloudRunClient

func (v *CloudRunServicesView) GetCloudRunClient() *gcp.CloudRunClient

GetCloudRunClient returns the Cloud Run client for reuse in detail views

func (*CloudRunServicesView) HasTextInputFocused

func (v *CloudRunServicesView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input or table filter is active

func (*CloudRunServicesView) Init

func (v *CloudRunServicesView) Init() tea.Cmd

Init initializes the view and starts loading services

func (*CloudRunServicesView) IsMenuOpen

func (v *CloudRunServicesView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*CloudRunServicesView) SetContext

func (v *CloudRunServicesView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*CloudRunServicesView) Update

func (v *CloudRunServicesView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the Cloud Run services view

func (*CloudRunServicesView) View

func (v *CloudRunServicesView) View() string

View renders the Cloud Run services view

type CloudRunTrafficUpdateMsg

type CloudRunTrafficUpdateMsg struct {
	FullName string
	Targets  []gcp.CloudRunTrafficTarget
}

CloudRunTrafficUpdateMsg is sent when user submits a traffic split update

type CreateDiskFromImageMsg

type CreateDiskFromImageMsg struct {
	ImageName   string
	DiskName    string
	Description string
	Zone        string
	DiskType    string // pd-standard, pd-ssd, pd-balanced
	SizeGB      int64
	Labels      map[string]string
}

CreateDiskFromImageMsg is sent when creating a disk from an image

type CreateDiskFromSnapshotMsg

type CreateDiskFromSnapshotMsg struct {
	SnapshotName string
	DiskName     string
	Description  string
	Zone         string
	DiskType     string // pd-standard, pd-ssd, pd-balanced
	SizeGB       int64
	Labels       map[string]string
}

CreateDiskFromSnapshotMsg is sent when creating a disk from a snapshot

type CreateImageFromDiskMsg

type CreateImageFromDiskMsg struct {
	DiskName        string
	Zone            string
	ImageName       string
	Description     string
	Family          string
	Labels          map[string]string
	StorageLocation string // Regional or multi-regional location
	ForceCreate     bool   // If true, create image even if disk is attached to running instance
}

CreateImageFromDiskMsg is sent when creating an image from a disk

type CreateImageFromSnapshotMsg

type CreateImageFromSnapshotMsg struct {
	SnapshotName    string
	ImageName       string
	Description     string
	Family          string
	Labels          map[string]string
	StorageLocation string // Regional or multi-regional location
}

CreateImageFromSnapshotMsg is sent when creating an image from a snapshot

type CreateInstanceMsg

type CreateInstanceMsg struct {
	ProjectID string
	Config    gcp.InstanceCreateConfig
}

CreateInstanceMsg carries the config to actually create the instance via the GCP API

type CreateRouteMsg added in v0.8.0

type CreateRouteMsg struct {
	Config gcp.RouteConfig
}

CreateRouteMsg is emitted by the create form for the app handler to execute

type CreateSQLBackupMsg

type CreateSQLBackupMsg struct {
	InstanceName string
	Description  string
}

CreateSQLBackupMsg is sent when user requests an on-demand backup

type CreateServiceAccountKeyMsg

type CreateServiceAccountKeyMsg struct {
	Email string
}

CreateServiceAccountKeyMsg is sent when user requests a new key

type CreateServiceAccountMsg

type CreateServiceAccountMsg struct {
	ProjectID   string
	AccountID   string
	DisplayName string
	Description string
}

CreateServiceAccountMsg is sent when the create form is submitted

type CreateSnapshotFromDiskMsg

type CreateSnapshotFromDiskMsg struct {
	DiskName        string
	Zone            string
	SnapshotName    string
	Description     string
	Labels          map[string]string
	StorageLocation string // Regional or multi-regional location
}

CreateSnapshotFromDiskMsg is sent when creating a snapshot from a disk

type CreateSubnetMsg added in v0.7.0

type CreateSubnetMsg struct {
	Config gcp.SubnetCreateConfig
}

CreateSubnetMsg carries the form data to create a subnet

type CreateViewBase

type CreateViewBase struct {
	Form    *forms.Form
	Spinner spinner.Model
	State   createViewState
	Err     error
	Keys    createViewKeyMap
	Ctx     *context.ProgramContext
	Width   int
	Height  int

	// SavingMsg is the message shown during the saving state (e.g. "Creating snapshot...")
	SavingMsg string
}

CreateViewBase provides shared lifecycle for resource creation views. Embed in concrete creation views to avoid repeating state machine, spinner, form sizing, and error handling boilerplate.

func NewCreateViewBase

func NewCreateViewBase(savingMsg string) CreateViewBase

NewCreateViewBase creates a new base with standard GCP spinner and key map.

func (*CreateViewBase) BeginSaving

func (b *CreateViewBase) BeginSaving() tea.Cmd

BeginSaving transitions to saving state and returns a spinner tick command.

func (*CreateViewBase) HandleBaseUpdate

func (b *CreateViewBase) HandleBaseUpdate(msg tea.Msg, cancelMsg tea.Msg) (tea.Cmd, bool)

HandleBaseUpdate handles spinner ticks and cancel-during-saving. Returns (cmd, handled). If handled is true, the caller should return cmd. cancelMsg is the message to emit when the user cancels.

func (*CreateViewBase) HasTextInputFocused

func (b *CreateViewBase) HasTextInputFocused() bool

HasTextInputFocused delegates to the form.

func (*CreateViewBase) Init

func (b *CreateViewBase) Init() tea.Cmd

Init delegates to the form's Init.

func (*CreateViewBase) IsSaving

func (b *CreateViewBase) IsSaving() bool

IsSaving returns true if the view is in the saving state.

func (*CreateViewBase) SetContext

func (b *CreateViewBase) SetContext(ctx *context.ProgramContext)

SetContext updates dimensions and propagates to the form.

func (*CreateViewBase) SetError

func (b *CreateViewBase) SetError(err error)

SetError resets the view to form state and stores the error.

func (*CreateViewBase) UpdateForm

func (b *CreateViewBase) UpdateForm(msg tea.Msg) tea.Cmd

UpdateForm delegates a message to the form. Call this as the final fallthrough.

func (*CreateViewBase) View

func (b *CreateViewBase) View() string

View renders the form with error, or the saving spinner.

type CustomRoleDetailsView

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

CustomRoleDetailsView displays custom role information with tabs

func NewCustomRoleDetailsView

func NewCustomRoleDetailsView(projectID, roleID string, iamClient *gcp.IAMClient) *CustomRoleDetailsView

NewCustomRoleDetailsView creates a new custom role details view

func (*CustomRoleDetailsView) GetIAMClient

func (v *CustomRoleDetailsView) GetIAMClient() *gcp.IAMClient

GetIAMClient returns the IAM client for reuse

func (*CustomRoleDetailsView) GetRoleID

func (v *CustomRoleDetailsView) GetRoleID() string

GetRoleID returns the role ID for breadcrumbs

func (*CustomRoleDetailsView) Init

func (v *CustomRoleDetailsView) Init() tea.Cmd

Init starts loading the role details

func (*CustomRoleDetailsView) SetContext

func (v *CustomRoleDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*CustomRoleDetailsView) Update

func (v *CustomRoleDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages

func (*CustomRoleDetailsView) View

func (v *CustomRoleDetailsView) View() string

View renders the custom role details view

type CustomRoleSelectedMsg

type CustomRoleSelectedMsg struct {
	Role gcp.CustomRole
}

CustomRoleSelectedMsg is sent when a custom role is selected from the list

type CustomRolesView

type CustomRolesView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

CustomRolesView displays custom IAM roles in a table format

func NewCustomRolesView

func NewCustomRolesView(projectID string) *CustomRolesView

NewCustomRolesView creates a new custom roles list view

func (*CustomRolesView) GetIAMClient

func (v *CustomRolesView) GetIAMClient() *gcp.IAMClient

GetIAMClient returns the IAM client for reuse

func (*CustomRolesView) Init

func (v *CustomRolesView) Init() tea.Cmd

Init initializes the view

func (*CustomRolesView) SetContext

func (v *CustomRolesView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*CustomRolesView) Update

func (v *CustomRolesView) Update(msg tea.Msg) tea.Cmd

Update handles messages

func (*CustomRolesView) View

func (v *CustomRolesView) View() string

View renders the custom roles view

type DeleteCloudRunServiceConfirmedMsg

type DeleteCloudRunServiceConfirmedMsg struct {
	FullName string
	Name     string
}

DeleteCloudRunServiceConfirmedMsg is sent when user confirms Cloud Run service deletion

type DeleteDiskConfirmedMsg

type DeleteDiskConfirmedMsg struct {
	DiskName string
	Zone     string
}

DeleteDiskConfirmedMsg is sent after user confirms disk deletion

type DeleteDiskRequestMsg

type DeleteDiskRequestMsg struct {
	DiskName string
	Zone     string
}

DeleteDiskRequestMsg is sent when delete disk action is triggered Contains the disk info for confirmation dialog

type DeleteFirewallConfirmedMsg

type DeleteFirewallConfirmedMsg struct {
	RuleName string
}

DeleteFirewallConfirmedMsg is sent when user confirms firewall rule deletion

type DeleteImageConfirmedMsg

type DeleteImageConfirmedMsg struct {
	ImageName string
}

DeleteImageConfirmedMsg is sent after user confirms image deletion

type DeleteInstanceConfirmedMsg

type DeleteInstanceConfirmedMsg struct {
	InstanceName string
	Zone         string
}

DeleteInstanceConfirmedMsg is sent after user confirms instance deletion

type DeleteSQLInstanceConfirmedMsg

type DeleteSQLInstanceConfirmedMsg struct {
	InstanceName string
}

DeleteSQLInstanceConfirmedMsg is sent when user confirms SQL instance deletion

type DeleteServiceAccountConfirmedMsg

type DeleteServiceAccountConfirmedMsg struct {
	Email string
}

DeleteServiceAccountConfirmedMsg is sent when user confirms service account deletion

type DeleteServiceAccountKeyMsg

type DeleteServiceAccountKeyMsg struct {
	KeyName string
	Email   string
}

DeleteServiceAccountKeyMsg is sent when user confirms key deletion

type DeleteSnapshotConfirmedMsg

type DeleteSnapshotConfirmedMsg struct {
	SnapshotName string
}

DeleteSnapshotConfirmedMsg is sent after user confirms snapshot deletion

type DeleteSnapshotRequestMsg

type DeleteSnapshotRequestMsg struct {
	Snapshot gcp.Snapshot
}

DeleteSnapshotRequestMsg is emitted when user requests to delete a snapshot

type DeleteSubnetConfirmedMsg added in v0.7.0

type DeleteSubnetConfirmedMsg struct {
	SubnetName string
	Region     string
}

DeleteSubnetConfirmedMsg is sent when user confirms subnet deletion

type DiskActionResultMsg

type DiskActionResultMsg struct {
	Action  string // "delete", "snapshot", "image"
	Success bool
	Error   error
}

DiskActionResultMsg is sent after a disk action completes

type DiskCreateCanceledMsg

type DiskCreateCanceledMsg struct{}

DiskCreateCanceledMsg indicates user canceled disk creation

type DiskCreateFromImageRequestMsg

type DiskCreateFromImageRequestMsg struct {
	ImageName string
	ImageSize int64 // Size in GB
}

DiskCreateFromImageRequestMsg requests opening the disk creation form for an image

type DiskCreateFromSnapshotRequestMsg

type DiskCreateFromSnapshotRequestMsg struct {
	SnapshotName string
	SnapshotSize int64 // Size in GB
}

DiskCreateFromSnapshotRequestMsg requests opening the disk creation form

type DiskCreateView

type DiskCreateView struct {
	CreateViewBase
	// contains filtered or unexported fields
}

DiskCreateView allows creating disks from snapshots or images

func NewDiskCreateView

func NewDiskCreateView(projectID, snapshotName string, snapshotSize int64, computeClient *gcp.ComputeClient) *DiskCreateView

NewDiskCreateView creates a new disk create view from a snapshot

func NewDiskCreateViewFromImage

func NewDiskCreateViewFromImage(projectID, imageName string, imageSize int64, computeClient *gcp.ComputeClient) *DiskCreateView

NewDiskCreateViewFromImage creates a new disk create view from an image

func (*DiskCreateView) GetComputeClient

func (v *DiskCreateView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*DiskCreateView) GetSourceName

func (v *DiskCreateView) GetSourceName() string

GetSourceName returns the source name (snapshot or image) for breadcrumbs

func (*DiskCreateView) GetSourceType

func (v *DiskCreateView) GetSourceType() DiskSourceType

GetSourceType returns whether source is snapshot or image

func (*DiskCreateView) Update

func (v *DiskCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the view

type DiskDetailsView

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

DiskDetailsView displays comprehensive disk information

func NewDiskDetailsView

func NewDiskDetailsView(projectID, zone, diskName string, computeClient *gcp.ComputeClient) *DiskDetailsView

NewDiskDetailsView creates a new disk details view

func (*DiskDetailsView) GetComputeClient

func (v *DiskDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*DiskDetailsView) GetDiskName

func (v *DiskDetailsView) GetDiskName() string

GetDiskName returns the disk name for use in breadcrumbs

func (*DiskDetailsView) Init

func (v *DiskDetailsView) Init() tea.Cmd

Init initializes the view and starts loading disk details

func (*DiskDetailsView) IsMenuOpen

func (v *DiskDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu is currently open

func (*DiskDetailsView) SetContext

func (v *DiskDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*DiskDetailsView) Update

func (v *DiskDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the disk details view

func (*DiskDetailsView) View

func (v *DiskDetailsView) View() string

View renders the disk details view

type DiskSelectedMsg

type DiskSelectedMsg struct {
	Disk gcp.Disk
}

DiskSelectedMsg is sent when a disk is selected from the list

type DiskSourceType

type DiskSourceType int

DiskSourceType indicates whether creating disk from snapshot or image

const (
	DiskSourceSnapshot DiskSourceType = iota
	DiskSourceImage
)

type DisksView

type DisksView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

DisksView displays Compute Engine disks in a table format

func NewDisksView

func NewDisksView(projectID string) *DisksView

NewDisksView creates a new disks view with table display

func (*DisksView) GetComputeClient

func (v *DisksView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*DisksView) HasTextInputFocused

func (v *DisksView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*DisksView) Init

func (v *DisksView) Init() tea.Cmd

Init initializes the view and starts loading disks

func (*DisksView) IsMenuOpen

func (v *DisksView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu is currently open

func (*DisksView) SetContext

func (v *DisksView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*DisksView) Update

func (v *DisksView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the disks view

func (*DisksView) View

func (v *DisksView) View() string

View renders the disks view

type DownloadServiceAccountKeyMsg

type DownloadServiceAccountKeyMsg struct {
	KeyJSON []byte
	KeyID   string
}

DownloadServiceAccountKeyMsg is sent when user explicitly downloads a pending key

type FirewallActionResultMsg

type FirewallActionResultMsg struct {
	Action  string // "delete", "enable", "disable"
	Success bool
	Error   error
}

FirewallActionResultMsg reports the result of an async firewall operation

type FirewallDetailsView

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

FirewallDetailsView displays comprehensive firewall rule information with tabs

func NewFirewallDetailsView

func NewFirewallDetailsView(projectID, ruleName string, computeClient *gcp.ComputeClient) *FirewallDetailsView

NewFirewallDetailsView creates a new firewall rule details view

func (*FirewallDetailsView) GetComputeClient

func (v *FirewallDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*FirewallDetailsView) GetRegions

func (v *FirewallDetailsView) GetRegions() []mouse.Region

GetRegions returns the current clickable regions

func (*FirewallDetailsView) GetRuleName

func (v *FirewallDetailsView) GetRuleName() string

GetRuleName returns the rule name for breadcrumbs

func (*FirewallDetailsView) HandleRegionClick

func (v *FirewallDetailsView) HandleRegionClick(regionID string) tea.Cmd

HandleRegionClick processes a click on a specific region

func (*FirewallDetailsView) HasTextInputFocused

func (v *FirewallDetailsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*FirewallDetailsView) Init

func (v *FirewallDetailsView) Init() tea.Cmd

Init starts loading firewall rule details

func (*FirewallDetailsView) IsMenuOpen

func (v *FirewallDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*FirewallDetailsView) SetContext

func (v *FirewallDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*FirewallDetailsView) Update

func (v *FirewallDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the firewall details view

func (*FirewallDetailsView) UpdateRegions

func (v *FirewallDetailsView) UpdateRegions(offsetX, offsetY int)

UpdateRegions calculates clickable regions for tabs, links, and viewport

func (*FirewallDetailsView) View

func (v *FirewallDetailsView) View() string

View renders the firewall details view

type FirewallSelectedMsg

type FirewallSelectedMsg struct {
	Firewall gcp.FirewallRule
}

FirewallSelectedMsg is sent when a firewall rule is selected from the list

type FirewallsView

type FirewallsView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

FirewallsView displays firewall rules in a table format

func NewFirewallsView

func NewFirewallsView(projectID string) *FirewallsView

NewFirewallsView creates a new firewall rules view with table display

func (*FirewallsView) GetComputeClient

func (v *FirewallsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*FirewallsView) HasTextInputFocused

func (v *FirewallsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input or table filter is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*FirewallsView) Init

func (v *FirewallsView) Init() tea.Cmd

Init initializes the view and starts loading firewall rules

func (*FirewallsView) IsMenuOpen

func (v *FirewallsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*FirewallsView) SetContext

func (v *FirewallsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*FirewallsView) Update

func (v *FirewallsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the firewalls view

func (*FirewallsView) View

func (v *FirewallsView) View() string

View renders the firewalls view

type FormDemoState

type FormDemoState int

FormDemoState tracks what part of the demo we're viewing

const (
	FormDemoStateForm FormDemoState = iota
	FormDemoStateDiff
	FormDemoStateDone
)

type FormDemoView

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

FormDemoView demonstrates all form components for testing. Access via command palette: "Form Demo (dev)"

func NewFormDemoView

func NewFormDemoView() *FormDemoView

NewFormDemoView creates a new form demo view

func (*FormDemoView) HasTextInputFocused

func (v *FormDemoView) HasTextInputFocused() bool

HasTextInputFocused returns true if a text input field is focused in the form. Used by app to know whether to capture character keys or handle globally.

func (*FormDemoView) Init

func (v *FormDemoView) Init() tea.Cmd

Init initializes the view

func (*FormDemoView) SetContext

func (v *FormDemoView) SetContext(ctx *context.ProgramContext)

SetContext updates the view context

func (*FormDemoView) Update

func (v *FormDemoView) Update(msg tea.Msg) tea.Cmd

Update handles input

func (*FormDemoView) View

func (v *FormDemoView) View() string

View renders the demo

type IAMPolicyUpdateResultMsg

type IAMPolicyUpdateResultMsg struct {
	Action string // "add_binding" or "remove_binding"
	Error  error
	Policy *gcp.IAMPolicy // Updated policy on success
}

IAMPolicyUpdateResultMsg reports the result of an IAM policy update

type IAMPolicyView

type IAMPolicyView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

IAMPolicyView displays project IAM bindings as tables with editing

func NewIAMPolicyView

func NewIAMPolicyView(projectID string) *IAMPolicyView

NewIAMPolicyView creates a new IAM policy view

func (*IAMPolicyView) GetIAMClient

func (v *IAMPolicyView) GetIAMClient() *gcp.IAMClient

GetIAMClient returns the IAM client for reuse

func (*IAMPolicyView) HasTextInputFocused

func (v *IAMPolicyView) HasTextInputFocused() bool

HasTextInputFocused returns true when any text input is active

func (*IAMPolicyView) Init

func (v *IAMPolicyView) Init() tea.Cmd

Init starts loading the IAM policy

func (*IAMPolicyView) IsConfirmShown

func (v *IAMPolicyView) IsConfirmShown() bool

IsConfirmShown returns whether the confirm dialog is visible (for testing)

func (*IAMPolicyView) IsInputShown

func (v *IAMPolicyView) IsInputShown() bool

IsInputShown returns whether the input dialog is visible (for testing)

func (*IAMPolicyView) IsMenuOpen

func (v *IAMPolicyView) IsMenuOpen() bool

IsMenuOpen returns true if an overlay or menu is open

func (*IAMPolicyView) IsOverlayShown

func (v *IAMPolicyView) IsOverlayShown() bool

IsOverlayShown returns whether the overlay is visible (for testing)

func (*IAMPolicyView) SetContext

func (v *IAMPolicyView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*IAMPolicyView) SetError

func (v *IAMPolicyView) SetError(err error)

SetError resets error state (called by app handlers)

func (*IAMPolicyView) SetLoading

func (v *IAMPolicyView) SetLoading(loading bool)

SetLoading sets the loading state (for testing)

func (*IAMPolicyView) SetPolicy

func (v *IAMPolicyView) SetPolicy(policy *gcp.IAMPolicy)

SetPolicy sets the policy and rebuilds tables (for testing)

func (*IAMPolicyView) SwitchToMemberTab

func (v *IAMPolicyView) SwitchToMemberTab()

SwitchToMemberTab switches to the "By Member" tab (for testing)

func (*IAMPolicyView) SwitchToRoleTab

func (v *IAMPolicyView) SwitchToRoleTab()

SwitchToRoleTab switches to the "By Role" tab (for testing)

func (*IAMPolicyView) Update

func (v *IAMPolicyView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the IAM policy view

func (*IAMPolicyView) UpdatePolicy

func (v *IAMPolicyView) UpdatePolicy(policy *gcp.IAMPolicy)

UpdatePolicy replaces the policy and rebuilds tables (called by app on successful update)

func (*IAMPolicyView) View

func (v *IAMPolicyView) View() string

View renders the IAM policy view

type ImageActionResultMsg

type ImageActionResultMsg struct {
	Action  string // "delete", "create_disk"
	Success bool
	Error   error
}

ImageActionResultMsg is sent after an image action completes

type ImageCreateCanceledMsg

type ImageCreateCanceledMsg struct{}

ImageCreateCanceledMsg indicates user canceled image creation

type ImageCreateFromSnapshotCanceledMsg

type ImageCreateFromSnapshotCanceledMsg struct{}

ImageCreateFromSnapshotCanceledMsg indicates user canceled image creation from snapshot

type ImageCreateFromSnapshotRequestMsg

type ImageCreateFromSnapshotRequestMsg struct {
	SnapshotName string
}

ImageCreateFromSnapshotRequestMsg requests opening the image creation form for a snapshot

type ImageCreateRequestMsg

type ImageCreateRequestMsg struct {
	DiskName   string
	Zone       string
	AttachedTo string // Instance name if attached, empty otherwise
}

ImageCreateRequestMsg requests opening the image creation form

type ImageCreateView

type ImageCreateView struct {
	CreateViewBase
	// contains filtered or unexported fields
}

ImageCreateView allows creating images from disks or snapshots

func NewImageCreateView

func NewImageCreateView(projectID, diskName, zone, attachedTo string, computeClient *gcp.ComputeClient) *ImageCreateView

NewImageCreateView creates a new image create view for creating from a disk

func NewImageCreateViewFromSnapshot

func NewImageCreateViewFromSnapshot(projectID, snapshotName string, computeClient *gcp.ComputeClient) *ImageCreateView

NewImageCreateViewFromSnapshot creates a new image create view for creating from a snapshot

func (*ImageCreateView) GetComputeClient

func (v *ImageCreateView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*ImageCreateView) GetDiskName

func (v *ImageCreateView) GetDiskName() string

GetDiskName returns the source disk name for breadcrumbs (backward compatibility)

func (*ImageCreateView) GetSnapshotName

func (v *ImageCreateView) GetSnapshotName() string

GetSnapshotName returns the source snapshot name for breadcrumbs

func (*ImageCreateView) GetSourceName

func (v *ImageCreateView) GetSourceName() string

GetSourceName returns the source name (disk or snapshot) for breadcrumbs

func (*ImageCreateView) IsFromSnapshot

func (v *ImageCreateView) IsFromSnapshot() bool

IsFromSnapshot returns true if image is being created from a snapshot

func (*ImageCreateView) Update

func (v *ImageCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the view

type ImageDetailsView

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

ImageDetailsView displays comprehensive disk image information

func NewImageDetailsView

func NewImageDetailsView(projectID, imageName string, computeClient *gcp.ComputeClient) *ImageDetailsView

NewImageDetailsView creates a new image details view

func (*ImageDetailsView) GetComputeClient

func (v *ImageDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in other views

func (*ImageDetailsView) GetImageName

func (v *ImageDetailsView) GetImageName() string

GetImageName returns the image name for use in breadcrumbs

func (*ImageDetailsView) Init

func (v *ImageDetailsView) Init() tea.Cmd

Init initializes the view and starts loading image details

func (*ImageDetailsView) IsMenuOpen

func (v *ImageDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or confirm dialog is currently open

func (*ImageDetailsView) SetContext

func (v *ImageDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*ImageDetailsView) Update

func (v *ImageDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the image details view

func (*ImageDetailsView) View

func (v *ImageDetailsView) View() string

View renders the image details view

type ImageSelectedMsg

type ImageSelectedMsg struct {
	Image gcp.Image
}

ImageSelectedMsg is sent when an image is selected from the list

type ImageSourceType

type ImageSourceType int

ImageSourceType indicates the source type for image creation

const (
	ImageSourceDisk ImageSourceType = iota
	ImageSourceSnapshot
)

type ImagesView

type ImagesView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

ImagesView displays Compute Engine disk images in a table format

func NewImagesView

func NewImagesView(projectID string) *ImagesView

NewImagesView creates a new images view with table display

func (*ImagesView) GetComputeClient

func (v *ImagesView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*ImagesView) HasTextInputFocused

func (v *ImagesView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*ImagesView) Init

func (v *ImagesView) Init() tea.Cmd

Init initializes the view and starts loading images

func (*ImagesView) IsMenuOpen

func (v *ImagesView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or confirm dialog is currently open

func (*ImagesView) SetContext

func (v *ImagesView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*ImagesView) Update

func (v *ImagesView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the images view

func (*ImagesView) View

func (v *ImagesView) View() string

View renders the images view

type InstanceActionResultMsg

type InstanceActionResultMsg struct {
	Action  string // "delete"
	Success bool
	Error   error
}

InstanceActionResultMsg is sent after an instance action completes

type InstanceConfigEditCanceledMsg

type InstanceConfigEditCanceledMsg struct{}

InstanceConfigEditCanceledMsg indicates user canceled config editing

type InstanceConfigEditChange

type InstanceConfigEditChange struct {
	Field    string // "machine_type", "disk_size"
	OldValue string
	NewValue string
}

InstanceConfigEditChange represents a single change to apply during config edit

type InstanceConfigEditRequestMsg

type InstanceConfigEditRequestMsg struct {
	ProjectID    string
	InstanceName string
	Zone         string
}

InstanceConfigEditRequestMsg requests opening the config edit view. Distinct from InstanceEditRequestMsg which handles labels/tags editing.

type InstanceConfigEditResultMsg

type InstanceConfigEditResultMsg struct {
	Action        string // "config_edit"
	Success       bool
	Error         error
	PartialErrors []string // individual step failures
}

InstanceConfigEditResultMsg reports the outcome of the config edit

type InstanceConfigEditSubmitMsg

type InstanceConfigEditSubmitMsg struct {
	ProjectID    string
	InstanceName string
	Zone         string
	BootDiskName string // actual boot disk name (may differ from instance name)
	Changes      []InstanceConfigEditChange
}

InstanceConfigEditSubmitMsg carries the changes to apply to the instance

type InstanceConfigEditView

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

InstanceConfigEditView allows editing VM instance configuration (machine type, disk size). Follows the Loading -> Form -> Diff -> Saving state machine like cloudrun_edit.go.

func NewInstanceConfigEditView

func NewInstanceConfigEditView(projectID, instanceName, zone string, computeClient *gcp.ComputeClient) *InstanceConfigEditView

NewInstanceConfigEditView creates a new instance config edit view.

func (*InstanceConfigEditView) GetComputeClient

func (v *InstanceConfigEditView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*InstanceConfigEditView) GetInstanceName

func (v *InstanceConfigEditView) GetInstanceName() string

GetInstanceName returns the instance name for breadcrumbs

func (*InstanceConfigEditView) HasTextInputFocused

func (v *InstanceConfigEditView) HasTextInputFocused() bool

HasTextInputFocused returns true if a text input is active.

func (*InstanceConfigEditView) Init

func (v *InstanceConfigEditView) Init() tea.Cmd

Init starts loading instance details and machine types in parallel.

func (*InstanceConfigEditView) SetContext

func (v *InstanceConfigEditView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*InstanceConfigEditView) SetError

func (v *InstanceConfigEditView) SetError(err error)

SetError allows the app to propagate async errors back to the view.

func (*InstanceConfigEditView) Update

func (v *InstanceConfigEditView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the config edit view.

func (*InstanceConfigEditView) View

func (v *InstanceConfigEditView) View() string

View renders the config edit view.

type InstanceCreateCanceledMsg

type InstanceCreateCanceledMsg struct{}

InstanceCreateCanceledMsg indicates user canceled creation

type InstanceCreateRequestMsg

type InstanceCreateRequestMsg struct {
	ProjectID string
}

InstanceCreateRequestMsg requests opening the create view

type InstanceCreateResultMsg

type InstanceCreateResultMsg struct {
	Name    string
	Success bool
	Error   error
}

InstanceCreateResultMsg reports the outcome of the create operation

type InstanceCreateView

type InstanceCreateView struct {
	CreateViewBase
	// contains filtered or unexported fields
}

InstanceCreateView allows creating a new VM instance using a form. Uses CreateViewBase for form/saving states, adds a confirmation diff step in between.

func NewInstanceCreateView

func NewInstanceCreateView(projectID string, computeClient *gcp.ComputeClient) *InstanceCreateView

NewInstanceCreateView creates a new instance create view.

func (*InstanceCreateView) GetComputeClient

func (v *InstanceCreateView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*InstanceCreateView) GetInstanceName

func (v *InstanceCreateView) GetInstanceName() string

GetInstanceName returns the entered name, used for result messages.

func (*InstanceCreateView) GetProjectID

func (v *InstanceCreateView) GetProjectID() string

GetProjectID returns the project ID for breadcrumbs.

func (*InstanceCreateView) Init

func (v *InstanceCreateView) Init() tea.Cmd

Init starts the form and triggers initial network and machine type loading.

func (*InstanceCreateView) SetContext

func (v *InstanceCreateView) SetContext(ctx *context.ProgramContext)

SetContext updates dimensions and propagates to form and diff viewer.

func (*InstanceCreateView) Update

func (v *InstanceCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the create view.

func (*InstanceCreateView) View

func (v *InstanceCreateView) View() string

View renders the current state: form, confirmation, or saving.

type InstanceDetailsView

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

InstanceDetailsView displays comprehensive instance information

func NewInstanceDetailsView

func NewInstanceDetailsView(projectID, zone, instanceName string, computeClient *gcp.ComputeClient, gcpClient *gcp.Client) *InstanceDetailsView

NewInstanceDetailsView creates a new instance details view

func (*InstanceDetailsView) Close

func (v *InstanceDetailsView) Close()

Close releases resources associated with the InstanceDetailsView. Should be called when the view is no longer active to prevent resource leaks.

func (*InstanceDetailsView) GetComputeClient

func (v *InstanceDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in other detail views

func (*InstanceDetailsView) GetInstanceName

func (v *InstanceDetailsView) GetInstanceName() string

GetInstanceName returns the instance name for use in breadcrumbs

func (*InstanceDetailsView) GetRegions

func (v *InstanceDetailsView) GetRegions() []mouse.Region

GetRegions returns the current clickable regions. Implements components.Clickable interface.

func (*InstanceDetailsView) HandleRegionClick

func (v *InstanceDetailsView) HandleRegionClick(regionID string) tea.Cmd

HandleRegionClick processes a click on a specific region by focusing it. Implements components.Clickable interface.

func (*InstanceDetailsView) HasTextInputFocused

func (v *InstanceDetailsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*InstanceDetailsView) Init

func (v *InstanceDetailsView) Init() tea.Cmd

Init initializes the view and starts loading instance details

func (*InstanceDetailsView) IsMenuOpen

func (v *InstanceDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*InstanceDetailsView) SetContext

func (v *InstanceDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*InstanceDetailsView) Update

func (v *InstanceDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the instance details view

func (*InstanceDetailsView) UpdateRegions

func (v *InstanceDetailsView) UpdateRegions(offsetX, offsetY int)

UpdateRegions calculates clickable regions for tabs, links, and viewport. Implements components.Clickable interface.

func (*InstanceDetailsView) View

func (v *InstanceDetailsView) View() string

View renders the instance details view

type InstanceDiskSelectedMsg

type InstanceDiskSelectedMsg struct {
	DiskName string
	Zone     string
}

InstanceDiskSelectedMsg is sent when a disk link is selected in instance details Contains disk info extracted from DiskInfo.Source URL

type InstanceEditCanceledMsg

type InstanceEditCanceledMsg struct{}

InstanceEditCanceledMsg indicates user canceled editing

type InstanceEditCompleteMsg

type InstanceEditCompleteMsg struct {
	InstanceName string
	EditType     string
}

InstanceEditCompleteMsg indicates successful edit, triggers refresh

type InstanceEditRequestMsg

type InstanceEditRequestMsg struct {
	ProjectID    string
	Zone         string
	InstanceName string
	EditMode     string // "labels", "tags", "description", "machine_type"
}

InstanceEditRequestMsg requests opening the instance editor. Used by views (like InstanceDetailsView) to request editing.

type InstanceEditorView

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

InstanceEditorView allows editing instance properties like labels

func NewInstanceEditorView

func NewInstanceEditorView(projectID, zone, instanceName string, computeClient *gcp.ComputeClient) *InstanceEditorView

NewInstanceEditorView creates a new instance editor view

func (*InstanceEditorView) GetComputeClient

func (v *InstanceEditorView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for passing to sub-views

func (*InstanceEditorView) HasTextInputFocused

func (v *InstanceEditorView) HasTextInputFocused() bool

HasTextInputFocused returns true if a text input field is currently focused

func (*InstanceEditorView) Init

func (v *InstanceEditorView) Init() tea.Cmd

Init initializes the view and starts loading labels

func (*InstanceEditorView) SetContext

func (v *InstanceEditorView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*InstanceEditorView) Update

func (v *InstanceEditorView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the instance editor view

func (*InstanceEditorView) View

func (v *InstanceEditorView) View() string

View renders the instance editor view

type InstanceMetadataView

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

InstanceMetadataView displays and manages instance metadata

func NewInstanceMetadataView

func NewInstanceMetadataView(projectID, zone, instanceName string, computeClient *gcp.ComputeClient) *InstanceMetadataView

NewInstanceMetadataView creates a new instance metadata view

func (*InstanceMetadataView) Init

func (v *InstanceMetadataView) Init() tea.Cmd

Init initializes the view and starts loading metadata

func (*InstanceMetadataView) SetContext

func (v *InstanceMetadataView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*InstanceMetadataView) Update

func (v *InstanceMetadataView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the instance metadata view

func (*InstanceMetadataView) View

func (v *InstanceMetadataView) View() string

View renders the instance metadata view

type InstanceSelectedMsg

type InstanceSelectedMsg struct {
	Instance gcp.Instance
}

InstanceSelectedMsg is sent when an instance is selected from the list

type InstancesView

type InstancesView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

InstancesView displays and manages Compute Engine instances in a table format

func NewInstancesView

func NewInstancesView(projectID string) *InstancesView

NewInstancesView creates a new instances view with table display

func (*InstancesView) GetComputeClient

func (v *InstancesView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*InstancesView) HasTextInputFocused

func (v *InstancesView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter or delete confirm input is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*InstancesView) Init

func (v *InstancesView) Init() tea.Cmd

Init initializes the view and starts loading instances

func (*InstancesView) IsMenuOpen

func (v *InstancesView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or a confirmation dialog is open

func (*InstancesView) SelectedInstance

func (v *InstancesView) SelectedInstance() *gcp.Instance

SelectedInstance returns the currently selected instance

func (*InstancesView) SetContext

func (v *InstancesView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*InstancesView) Update

func (v *InstancesView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the instances view

func (*InstancesView) View

func (v *InstancesView) View() string

View renders the instances view

type LogsView added in v0.6.0

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

LogsView is the main Logs Explorer view.

func NewLogsView added in v0.6.0

func NewLogsView(projectID string, gcpClient *gcp.Client) *LogsView

NewLogsView creates a new Logs Explorer view.

func (*LogsView) Close added in v0.6.0

func (v *LogsView) Close()

Close stops the tail ticker and cleans up resources.

func (*LogsView) HasTextInputFocused added in v0.6.0

func (v *LogsView) HasTextInputFocused() bool

HasTextInputFocused returns true when the query input or dropdown search is active.

func (*LogsView) Init added in v0.6.0

func (v *LogsView) Init() tea.Cmd

Init starts data loading. Must be idempotent — may be called more than once. Resource types and log names are loaded lazily on first dropdown open to reduce API calls (GCP logging read quota is 120 req/min).

func (*LogsView) IsMenuOpen added in v0.6.0

func (v *LogsView) IsMenuOpen() bool

IsMenuOpen returns true when the action menu is open. Used by the app to route Esc to the view instead of navigating back.

func (*LogsView) SetContext added in v0.6.0

func (v *LogsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*LogsView) Update added in v0.6.0

func (v *LogsView) Update(msg tea.Msg) tea.Cmd

Update handles all messages for the Logs Explorer view.

func (*LogsView) View added in v0.6.0

func (v *LogsView) View() string

View renders the Logs Explorer.

func (*LogsView) WithFilters added in v0.7.0

func (v *LogsView) WithFilters(query string, severities []string, timeRange time.Duration)

WithFilters pre-populates the Logs Explorer with filters from another view (e.g., Cloud Run observability). Call before Init().

type LogsViewRequestMsg added in v0.6.0

type LogsViewRequestMsg struct {
	// Query is an LQL filter string pre-filled in the query input.
	Query string
	// Severities pre-selects severity filters (e.g., []string{"ERROR", "WARNING"}).
	Severities []string
	// TimeRange pre-sets the time window. Zero means use default (1h).
	TimeRange time.Duration
}

LogsViewRequestMsg requests navigation to the Logs Explorer view. Optional fields allow pre-populating filters (e.g., from Cloud Run observability).

type MenuOpener interface {
	IsMenuOpen() bool
}

MenuOpener is an interface for views that can have a menu open.

type NetworkDetailsView

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

NetworkDetailsView displays comprehensive network information with tabs

func NewNetworkDetailsView

func NewNetworkDetailsView(projectID, networkName string, computeClient *gcp.ComputeClient) *NetworkDetailsView

NewNetworkDetailsView creates a new network details view

func (*NetworkDetailsView) GetComputeClient

func (v *NetworkDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*NetworkDetailsView) GetNetworkName

func (v *NetworkDetailsView) GetNetworkName() string

GetNetworkName returns the network name for breadcrumbs

func (*NetworkDetailsView) GetRegions

func (v *NetworkDetailsView) GetRegions() []mouse.Region

GetRegions returns the current clickable regions

func (*NetworkDetailsView) HandleRegionClick

func (v *NetworkDetailsView) HandleRegionClick(regionID string) tea.Cmd

HandleRegionClick processes a click on a specific region

func (*NetworkDetailsView) Init

func (v *NetworkDetailsView) Init() tea.Cmd

Init starts loading network details, subnets, and routes in parallel

func (*NetworkDetailsView) IsMenuOpen

func (v *NetworkDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu is open

func (*NetworkDetailsView) SetContext

func (v *NetworkDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*NetworkDetailsView) Update

func (v *NetworkDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the network details view

func (*NetworkDetailsView) UpdateRegions

func (v *NetworkDetailsView) UpdateRegions(offsetX, offsetY int)

UpdateRegions calculates clickable regions for tabs, links, and viewport

func (*NetworkDetailsView) View

func (v *NetworkDetailsView) View() string

View renders the network details view

type NetworkSelectedMsg

type NetworkSelectedMsg struct {
	Network gcp.Network
}

NetworkSelectedMsg is sent when a network is selected from the list

type NetworksView

type NetworksView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

NetworksView displays VPC networks in a table format

func NewNetworksView

func NewNetworksView(projectID string) *NetworksView

NewNetworksView creates a new networks view with table display

func (*NetworksView) GetComputeClient

func (v *NetworksView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*NetworksView) HasTextInputFocused

func (v *NetworksView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter is active.

func (*NetworksView) Init

func (v *NetworksView) Init() tea.Cmd

Init initializes the view and starts loading networks

func (*NetworksView) SetContext

func (v *NetworksView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*NetworksView) Update

func (v *NetworksView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the networks view

func (*NetworksView) View

func (v *NetworksView) View() string

View renders the networks view

type ObjectAction

type ObjectAction string

ObjectAction indicates what action to perform when opening object details

const (
	ObjectActionView    ObjectAction = ""        // Default: view details
	ObjectActionPreview ObjectAction = "preview" // Open preview tab
	ObjectActionOpen    ObjectAction = "open"    // Download and open with default app
)

type ObjectDeletedMsg

type ObjectDeletedMsg struct {
	ObjectName string
}

ObjectDeletedMsg signals that an object was deleted

type ObjectDetailsView

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

ObjectDetailsView displays comprehensive GCS object information

func NewObjectDetailsView

func NewObjectDetailsView(bucketName, objectName, displayName string, storageClient *gcp.StorageClient, action ObjectAction) *ObjectDetailsView

NewObjectDetailsView creates a new object details view

func (*ObjectDetailsView) GetBucketName

func (v *ObjectDetailsView) GetBucketName() string

GetBucketName returns the bucket name

func (*ObjectDetailsView) GetStorageClient

func (v *ObjectDetailsView) GetStorageClient() *gcp.StorageClient

GetStorageClient returns the storage client for reuse

func (*ObjectDetailsView) Init

func (v *ObjectDetailsView) Init() tea.Cmd

Init initializes the view and starts loading metadata

func (*ObjectDetailsView) IsMenuOpen

func (v *ObjectDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu is currently open

func (*ObjectDetailsView) SetContext

func (v *ObjectDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*ObjectDetailsView) Update

func (v *ObjectDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the object details view

func (*ObjectDetailsView) View

func (v *ObjectDetailsView) View() string

View renders the object details view

type ObjectSelectedMsg

type ObjectSelectedMsg struct {
	Object gcp.StorageObject
	Action ObjectAction // Optional action to perform (preview, open)
}

ObjectSelectedMsg signals that an object was selected for viewing details

type ObjectsBackMsg

type ObjectsBackMsg struct{}

ObjectsBackMsg signals to return to buckets view (exported for app.go)

type ObjectsView

type ObjectsView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

ObjectsView displays and manages objects within a bucket using a table format

func NewObjectsView

func NewObjectsView(bucketName string, storageClient *gcp.StorageClient) *ObjectsView

NewObjectsView creates a new objects view with table display

func (*ObjectsView) GetBucketName

func (v *ObjectsView) GetBucketName() string

GetBucketName returns the bucket name

func (*ObjectsView) GetCurrentPath

func (v *ObjectsView) GetCurrentPath() string

GetCurrentPath returns the current folder path being browsed

func (*ObjectsView) GetStorageClient

func (v *ObjectsView) GetStorageClient() *gcp.StorageClient

GetStorageClient returns the storage client for reuse

func (*ObjectsView) HandleBack

func (v *ObjectsView) HandleBack() (handled bool, cmd tea.Cmd)

HandleBack handles ESC key - returns true if handled internally (went up a folder)

func (*ObjectsView) HasTextInputFocused

func (v *ObjectsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*ObjectsView) Init

func (v *ObjectsView) Init() tea.Cmd

Init initializes the view and starts loading objects

func (*ObjectsView) IsFilePickerShown

func (v *ObjectsView) IsFilePickerShown() bool

IsFilePickerShown returns true if the file picker is currently shown

func (*ObjectsView) IsMenuOpen

func (v *ObjectsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu is currently open

func (*ObjectsView) SetContext

func (v *ObjectsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*ObjectsView) Update

func (v *ObjectsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the objects view

func (*ObjectsView) View

func (v *ObjectsView) View() string

View renders the objects view

type ProjectMetadataView

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

ProjectMetadataView displays and manages project-wide metadata This metadata applies to ALL instances in the project

func NewProjectMetadataView

func NewProjectMetadataView(projectID string, computeClient *gcp.ComputeClient) *ProjectMetadataView

NewProjectMetadataView creates a new project metadata view

func (*ProjectMetadataView) Init

func (v *ProjectMetadataView) Init() tea.Cmd

Init initializes the view and starts loading metadata

func (*ProjectMetadataView) SetContext

func (v *ProjectMetadataView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*ProjectMetadataView) Update

func (v *ProjectMetadataView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the project metadata view

func (*ProjectMetadataView) View

func (v *ProjectMetadataView) View() string

View renders the project metadata view

type ProjectSelectedMsg

type ProjectSelectedMsg struct {
	Project gcp.Project
}

ProjectSelectedMsg is emitted when a project is selected

type ProjectsView

type ProjectsView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

ProjectsView displays and manages the list of GCP projects in a table format

func NewProjectsView

func NewProjectsView(client *gcp.Client) *ProjectsView

NewProjectsView creates a new projects view with table display

func (*ProjectsView) HasTextInputFocused

func (v *ProjectsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*ProjectsView) Init

func (v *ProjectsView) Init() tea.Cmd

Init starts loading projects

func (*ProjectsView) SelectedProject

func (v *ProjectsView) SelectedProject() *gcp.Project

SelectedProject returns the currently selected project

func (*ProjectsView) SetContext

func (v *ProjectsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*ProjectsView) Update

func (v *ProjectsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the projects view

func (*ProjectsView) View

func (v *ProjectsView) View() string

View renders the projects view

type Recommendation

type Recommendation struct {
	Severity string // "warning", "critical"
	Message  string
	Action   string
}

Recommendation represents an actionable insight based on metrics

type RemoveIAMBindingMsg

type RemoveIAMBindingMsg struct {
	ProjectID      string
	Role           string
	ConditionTitle string
	Member         string
}

RemoveIAMBindingMsg requests removing a member from a role binding. ConditionTitle targets the specific binding when duplicate roles exist with different conditions.

type RouteCreateCanceledMsg added in v0.8.0

type RouteCreateCanceledMsg struct{}

RouteCreateCanceledMsg is sent when user cancels route creation

type RouteCreateRequestMsg added in v0.8.0

type RouteCreateRequestMsg struct {
	Network string
}

RouteCreateRequestMsg opens the route creation form. Network is optional — when set, pre-fills the network dropdown.

type RouteCreateResultMsg added in v0.8.0

type RouteCreateResultMsg struct {
	Error error
	Name  string
}

RouteCreateResultMsg reports the result of an async route creation

type RouteCreateView added in v0.8.0

type RouteCreateView struct {
	CreateViewBase
	// contains filtered or unexported fields
}

RouteCreateView provides a form-based UI for creating new static routes.

func NewRouteCreateView added in v0.8.0

func NewRouteCreateView(projectID string, computeClient *gcp.ComputeClient, presetNetwork string) *RouteCreateView

NewRouteCreateView creates a new route creation view.

func (*RouteCreateView) GetComputeClient added in v0.8.0

func (v *RouteCreateView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse.

func (*RouteCreateView) Init added in v0.8.0

func (v *RouteCreateView) Init() tea.Cmd

Init initializes the view and starts loading networks.

func (*RouteCreateView) Update added in v0.8.0

func (v *RouteCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the route creation view.

type RouteDeleteRequestMsg added in v0.8.0

type RouteDeleteRequestMsg struct {
	Name string
}

RouteDeleteRequestMsg triggers route deletion with confirmation

type RouteDeleteResultMsg added in v0.8.0

type RouteDeleteResultMsg struct {
	Error error
	Name  string
}

RouteDeleteResultMsg reports the result of an async route deletion

type RouteDetailsView added in v0.8.0

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

RouteDetailsView displays comprehensive route information in a scrollable viewport

func NewRouteDetailsView added in v0.8.0

func NewRouteDetailsView(projectID, routeName string, computeClient *gcp.ComputeClient) *RouteDetailsView

NewRouteDetailsView creates a new route details view

func (*RouteDetailsView) GetComputeClient added in v0.8.0

func (v *RouteDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*RouteDetailsView) GetRouteName added in v0.8.0

func (v *RouteDetailsView) GetRouteName() string

GetRouteName returns the route name for breadcrumbs

func (*RouteDetailsView) HasTextInputFocused added in v0.8.0

func (v *RouteDetailsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*RouteDetailsView) Init added in v0.8.0

func (v *RouteDetailsView) Init() tea.Cmd

Init starts loading route details

func (*RouteDetailsView) IsMenuOpen added in v0.8.0

func (v *RouteDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*RouteDetailsView) SetContext added in v0.8.0

func (v *RouteDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*RouteDetailsView) Update added in v0.8.0

func (v *RouteDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the route details view

func (*RouteDetailsView) View added in v0.8.0

func (v *RouteDetailsView) View() string

View renders the route details view

type RouteSelectedMsg added in v0.8.0

type RouteSelectedMsg struct {
	Route gcp.Route
}

RouteSelectedMsg navigates to route details

type RoutesRequestMsg added in v0.8.0

type RoutesRequestMsg struct{}

RoutesRequestMsg navigates to the routes list view

type RoutesView added in v0.8.0

type RoutesView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

RoutesView displays routes in a project in a table format

func NewRoutesView added in v0.8.0

func NewRoutesView(projectID string) *RoutesView

NewRoutesView creates a new routes view with table display

func (*RoutesView) GetComputeClient added in v0.8.0

func (v *RoutesView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*RoutesView) HasTextInputFocused added in v0.8.0

func (v *RoutesView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input or table filter is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*RoutesView) Init added in v0.8.0

func (v *RoutesView) Init() tea.Cmd

Init initializes the view and starts loading routes

func (*RoutesView) IsMenuOpen added in v0.8.0

func (v *RoutesView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*RoutesView) SetContext added in v0.8.0

func (v *RoutesView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*RoutesView) Update added in v0.8.0

func (v *RoutesView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the routes view

func (*RoutesView) View added in v0.8.0

func (v *RoutesView) View() string

View renders the routes view

type SQLBackupActionResultMsg

type SQLBackupActionResultMsg struct {
	Action  string // "create_backup"
	Success bool
	Error   error
}

SQLBackupActionResultMsg reports the result of a backup operation

type SQLInstanceActionMsg

type SQLInstanceActionMsg struct {
	InstanceName string
	Action       string // "start", "stop", "restart"
}

SQLInstanceActionMsg is sent when user requests a lifecycle action on a SQL instance

type SQLInstanceActionResultMsg

type SQLInstanceActionResultMsg struct {
	InstanceName string
	Action       string // "start", "stop", "restart", "delete"
	Success      bool
	Error        error
}

SQLInstanceActionResultMsg reports the result of an async SQL instance operation

type SQLInstanceDetailsView

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

SQLInstanceDetailsView displays comprehensive SQL instance information with tabs

func NewSQLInstanceDetailsView

func NewSQLInstanceDetailsView(projectID, instanceName string, sqlClient *gcp.SQLClient) *SQLInstanceDetailsView

NewSQLInstanceDetailsView creates a new SQL instance details view

func (*SQLInstanceDetailsView) GetInstanceName

func (v *SQLInstanceDetailsView) GetInstanceName() string

GetInstanceName returns the instance name for breadcrumbs

func (*SQLInstanceDetailsView) GetRegions

func (v *SQLInstanceDetailsView) GetRegions() []mouse.Region

GetRegions returns the current clickable regions

func (*SQLInstanceDetailsView) GetSQLClient

func (v *SQLInstanceDetailsView) GetSQLClient() *gcp.SQLClient

GetSQLClient returns the SQL client for reuse

func (*SQLInstanceDetailsView) HandleRegionClick

func (v *SQLInstanceDetailsView) HandleRegionClick(regionID string) tea.Cmd

HandleRegionClick processes a click on a specific region

func (*SQLInstanceDetailsView) HasTextInputFocused

func (v *SQLInstanceDetailsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*SQLInstanceDetailsView) Init

func (v *SQLInstanceDetailsView) Init() tea.Cmd

Init starts loading all datasets in parallel

func (*SQLInstanceDetailsView) IsMenuOpen

func (v *SQLInstanceDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*SQLInstanceDetailsView) SetContext

func (v *SQLInstanceDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*SQLInstanceDetailsView) Update

func (v *SQLInstanceDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the SQL instance details view

func (*SQLInstanceDetailsView) UpdateRegions

func (v *SQLInstanceDetailsView) UpdateRegions(offsetX, offsetY int)

UpdateRegions calculates clickable regions for tabs and viewport

func (*SQLInstanceDetailsView) View

func (v *SQLInstanceDetailsView) View() string

View renders the SQL instance details view

type SQLInstanceSelectedMsg

type SQLInstanceSelectedMsg struct {
	Instance gcp.SQLInstance
}

SQLInstanceSelectedMsg is sent when a SQL instance is selected from the list

type SQLInstancesView

type SQLInstancesView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

SQLInstancesView displays Cloud SQL instances in a table format

func NewSQLInstancesView

func NewSQLInstancesView(projectID string) *SQLInstancesView

NewSQLInstancesView creates a new Cloud SQL instances view with table display

func (*SQLInstancesView) GetSQLClient

func (v *SQLInstancesView) GetSQLClient() *gcp.SQLClient

GetSQLClient returns the SQL client for reuse in detail views

func (*SQLInstancesView) HasTextInputFocused

func (v *SQLInstancesView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input or table filter is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*SQLInstancesView) Init

func (v *SQLInstancesView) Init() tea.Cmd

Init initializes the view and starts loading SQL instances

func (*SQLInstancesView) IsMenuOpen

func (v *SQLInstancesView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*SQLInstancesView) SetContext

func (v *SQLInstancesView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*SQLInstancesView) Update

func (v *SQLInstancesView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the SQL instances view

func (*SQLInstancesView) View

func (v *SQLInstancesView) View() string

View renders the SQL instances view

type ServiceAccountActionResultMsg

type ServiceAccountActionResultMsg struct {
	Action  string // "create", "delete", "enable", "disable"
	Success bool
	Error   error
}

ServiceAccountActionResultMsg reports the result of an async service account operation

type ServiceAccountCreateCanceledMsg

type ServiceAccountCreateCanceledMsg struct{}

ServiceAccountCreateCanceledMsg is sent when user cancels service account creation

type ServiceAccountCreateRequestMsg

type ServiceAccountCreateRequestMsg struct {
	ProjectID string
}

ServiceAccountCreateRequestMsg is sent when user wants to create a new service account

type ServiceAccountCreateView

type ServiceAccountCreateView struct {
	CreateViewBase
	// contains filtered or unexported fields
}

ServiceAccountCreateView allows creating new service accounts

func NewServiceAccountCreateView

func NewServiceAccountCreateView(projectID string, iamClient *gcp.IAMClient) *ServiceAccountCreateView

NewServiceAccountCreateView creates a new service account create view

func (*ServiceAccountCreateView) GetIAMClient

func (v *ServiceAccountCreateView) GetIAMClient() *gcp.IAMClient

GetIAMClient returns the IAM client for reuse

func (*ServiceAccountCreateView) Update

func (v *ServiceAccountCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the view

type ServiceAccountDetailsView

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

ServiceAccountDetailsView displays comprehensive service account information with tabs

func NewServiceAccountDetailsView

func NewServiceAccountDetailsView(projectID, email string, iamClient *gcp.IAMClient) *ServiceAccountDetailsView

NewServiceAccountDetailsView creates a new service account details view

func (*ServiceAccountDetailsView) ClearPendingKey

func (v *ServiceAccountDetailsView) ClearPendingKey()

ClearPendingKey removes the pending key data after download

func (*ServiceAccountDetailsView) GetEmail

func (v *ServiceAccountDetailsView) GetEmail() string

GetEmail returns the email for breadcrumbs

func (*ServiceAccountDetailsView) GetIAMClient

func (v *ServiceAccountDetailsView) GetIAMClient() *gcp.IAMClient

GetIAMClient returns the IAM client for reuse

func (*ServiceAccountDetailsView) HasPendingKey

func (v *ServiceAccountDetailsView) HasPendingKey() bool

HasPendingKey returns true if a key is waiting for download

func (*ServiceAccountDetailsView) HasTextInputFocused

func (v *ServiceAccountDetailsView) HasTextInputFocused() bool

HasTextInputFocused returns true if a confirm dialog input is active

func (*ServiceAccountDetailsView) Init

func (v *ServiceAccountDetailsView) Init() tea.Cmd

Init starts loading all datasets in parallel

func (*ServiceAccountDetailsView) IsMenuOpen

func (v *ServiceAccountDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or a confirm dialog is open

func (*ServiceAccountDetailsView) SetContext

func (v *ServiceAccountDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*ServiceAccountDetailsView) SetPendingKey

func (v *ServiceAccountDetailsView) SetPendingKey(keyJSON []byte, keyID string)

SetPendingKey stores key data after creation — user must explicitly download

func (*ServiceAccountDetailsView) Update

func (v *ServiceAccountDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the service account details view

func (*ServiceAccountDetailsView) View

View renders the service account details view

type ServiceAccountKeyActionResultMsg

type ServiceAccountKeyActionResultMsg struct {
	Action  string // "create_key", "delete_key"
	Success bool
	Error   error
	KeyJSON []byte // Only set on successful create_key — one-time download
	KeyID   string
}

ServiceAccountKeyActionResultMsg reports the result of a key operation

type ServiceAccountSelectedMsg

type ServiceAccountSelectedMsg struct {
	ServiceAccount gcp.ServiceAccount
}

ServiceAccountSelectedMsg is sent when a service account is selected from the list

type ServiceAccountsView

type ServiceAccountsView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

ServiceAccountsView displays service accounts in a table format

func NewServiceAccountsView

func NewServiceAccountsView(projectID string) *ServiceAccountsView

NewServiceAccountsView creates a new service accounts list view

func (*ServiceAccountsView) GetIAMClient

func (v *ServiceAccountsView) GetIAMClient() *gcp.IAMClient

GetIAMClient returns the IAM client for reuse in detail views

func (*ServiceAccountsView) HasTextInputFocused

func (v *ServiceAccountsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input or table filter is active

func (*ServiceAccountsView) Init

func (v *ServiceAccountsView) Init() tea.Cmd

Init initializes the view and starts loading service accounts

func (*ServiceAccountsView) IsMenuOpen

func (v *ServiceAccountsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*ServiceAccountsView) SetContext

func (v *ServiceAccountsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*ServiceAccountsView) Update

func (v *ServiceAccountsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the service accounts view

func (*ServiceAccountsView) View

func (v *ServiceAccountsView) View() string

View renders the service accounts view

type SnapshotActionResultMsg

type SnapshotActionResultMsg struct {
	Action  string // "delete", "create_disk"
	Success bool
	Error   error
}

SnapshotActionResultMsg is sent after a snapshot action completes

type SnapshotCreateCanceledMsg

type SnapshotCreateCanceledMsg struct{}

SnapshotCreateCanceledMsg indicates user canceled snapshot creation

type SnapshotCreateRequestMsg

type SnapshotCreateRequestMsg struct {
	DiskName   string
	Zone       string
	AttachedTo string // Instance name if attached, empty otherwise
}

SnapshotCreateRequestMsg requests opening the snapshot creation form

type SnapshotCreateView

type SnapshotCreateView struct {
	CreateViewBase
	// contains filtered or unexported fields
}

SnapshotCreateView allows creating snapshots from disks

func NewSnapshotCreateView

func NewSnapshotCreateView(projectID, diskName, zone, attachedTo string, computeClient *gcp.ComputeClient) *SnapshotCreateView

NewSnapshotCreateView creates a new snapshot create view

func (*SnapshotCreateView) GetComputeClient

func (v *SnapshotCreateView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*SnapshotCreateView) GetDiskName

func (v *SnapshotCreateView) GetDiskName() string

GetDiskName returns the source disk name for breadcrumbs

func (*SnapshotCreateView) Update

func (v *SnapshotCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the view

type SnapshotDetailsView

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

SnapshotDetailsView displays comprehensive snapshot information

func NewSnapshotDetailsView

func NewSnapshotDetailsView(projectID, snapshotName string, computeClient *gcp.ComputeClient) *SnapshotDetailsView

NewSnapshotDetailsView creates a new snapshot details view

func (*SnapshotDetailsView) GetComputeClient

func (v *SnapshotDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in other detail views

func (*SnapshotDetailsView) GetSnapshotName

func (v *SnapshotDetailsView) GetSnapshotName() string

GetSnapshotName returns the snapshot name for use in breadcrumbs

func (*SnapshotDetailsView) Init

func (v *SnapshotDetailsView) Init() tea.Cmd

Init initializes the view and starts loading snapshot details

func (*SnapshotDetailsView) IsMenuOpen

func (v *SnapshotDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or confirm dialog is currently open

func (*SnapshotDetailsView) SetContext

func (v *SnapshotDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context. Reads dimensions from the context for consistent sizing.

func (*SnapshotDetailsView) Update

func (v *SnapshotDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the snapshot details view

func (*SnapshotDetailsView) View

func (v *SnapshotDetailsView) View() string

View renders the snapshot details view

type SnapshotDiskSelectedMsg

type SnapshotDiskSelectedMsg struct {
	DiskName string
	Zone     string
}

SnapshotDiskSelectedMsg is sent when a disk link is selected in snapshot details

type SnapshotSelectedMsg

type SnapshotSelectedMsg struct {
	Snapshot gcp.Snapshot
}

SnapshotSelectedMsg is emitted when a snapshot is selected

type SnapshotsView

type SnapshotsView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

SnapshotsView displays Compute Engine disk snapshots in a table format

func NewSnapshotsView

func NewSnapshotsView(projectID string) *SnapshotsView

NewSnapshotsView creates a new snapshots view with table display

func (*SnapshotsView) GetComputeClient

func (v *SnapshotsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*SnapshotsView) HasTextInputFocused

func (v *SnapshotsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the table filter is active. Used to prevent global hotkeys (like 'q' for quit) from triggering while typing.

func (*SnapshotsView) Init

func (v *SnapshotsView) Init() tea.Cmd

Init initializes the view and starts loading snapshots

func (*SnapshotsView) IsMenuOpen

func (v *SnapshotsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or confirm dialog is currently open

func (*SnapshotsView) SetContext

func (v *SnapshotsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*SnapshotsView) Update

func (v *SnapshotsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the snapshots view

func (*SnapshotsView) View

func (v *SnapshotsView) View() string

View renders the snapshots view

type SubnetActionResultMsg added in v0.7.0

type SubnetActionResultMsg struct {
	Action  string // "delete", "create"
	Success bool
	Error   error
}

SubnetActionResultMsg reports the result of an async subnet operation

type SubnetCreateCanceledMsg added in v0.7.0

type SubnetCreateCanceledMsg struct{}

SubnetCreateCanceledMsg is sent when user cancels subnet creation

type SubnetCreateRequestMsg added in v0.7.0

type SubnetCreateRequestMsg struct{}

SubnetCreateRequestMsg is sent to open the subnet creation form

type SubnetCreateView added in v0.7.0

type SubnetCreateView struct {
	CreateViewBase
	// contains filtered or unexported fields
}

SubnetCreateView provides a form-based UI for creating new subnets.

func NewSubnetCreateView added in v0.7.0

func NewSubnetCreateView(projectID string, computeClient *gcp.ComputeClient) *SubnetCreateView

NewSubnetCreateView creates a new subnet creation view.

func (*SubnetCreateView) GetComputeClient added in v0.7.0

func (v *SubnetCreateView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse.

func (*SubnetCreateView) Init added in v0.7.0

func (v *SubnetCreateView) Init() tea.Cmd

Init initializes the view and starts loading networks.

func (*SubnetCreateView) Update added in v0.7.0

func (v *SubnetCreateView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the subnet creation view.

type SubnetDetailsView added in v0.7.0

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

SubnetDetailsView displays comprehensive subnet information in a scrollable viewport

func NewSubnetDetailsView added in v0.7.0

func NewSubnetDetailsView(projectID, region, subnetName string, computeClient *gcp.ComputeClient) *SubnetDetailsView

NewSubnetDetailsView creates a new subnet details view

func (*SubnetDetailsView) GetComputeClient added in v0.7.0

func (v *SubnetDetailsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse

func (*SubnetDetailsView) GetSubnetName added in v0.7.0

func (v *SubnetDetailsView) GetSubnetName() string

GetSubnetName returns the subnet name for breadcrumbs

func (*SubnetDetailsView) HasTextInputFocused added in v0.7.0

func (v *SubnetDetailsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*SubnetDetailsView) Init added in v0.7.0

func (v *SubnetDetailsView) Init() tea.Cmd

Init starts loading subnet details

func (*SubnetDetailsView) IsMenuOpen added in v0.7.0

func (v *SubnetDetailsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*SubnetDetailsView) SetContext added in v0.7.0

func (v *SubnetDetailsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context

func (*SubnetDetailsView) Update added in v0.7.0

func (v *SubnetDetailsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the subnet details view

func (*SubnetDetailsView) View added in v0.7.0

func (v *SubnetDetailsView) View() string

View renders the subnet details view

type SubnetSelectedMsg added in v0.7.0

type SubnetSelectedMsg struct {
	SubnetName string
	Region     string
}

SubnetSelectedMsg is sent when a subnet is selected from the list or network details

type SubnetsView added in v0.7.0

type SubnetsView struct {
	TableClickDelegate
	// contains filtered or unexported fields
}

SubnetsView displays subnets across all networks/regions in a table format

func NewSubnetsView added in v0.7.0

func NewSubnetsView(projectID string) *SubnetsView

NewSubnetsView creates a new subnets view with table display

func (*SubnetsView) GetComputeClient added in v0.7.0

func (v *SubnetsView) GetComputeClient() *gcp.ComputeClient

GetComputeClient returns the compute client for reuse in detail views

func (*SubnetsView) HasTextInputFocused added in v0.7.0

func (v *SubnetsView) HasTextInputFocused() bool

HasTextInputFocused returns true if the delete confirm input or table filter is active. Prevents global hotkeys (like 'q' for quit) from triggering while typing.

func (*SubnetsView) Init added in v0.7.0

func (v *SubnetsView) Init() tea.Cmd

Init initializes the view and starts loading subnets

func (*SubnetsView) IsMenuOpen added in v0.7.0

func (v *SubnetsView) IsMenuOpen() bool

IsMenuOpen returns true if the action menu or delete confirm is open

func (*SubnetsView) SetContext added in v0.7.0

func (v *SubnetsView) SetContext(ctx *context.ProgramContext)

SetContext updates the view with shared program context.

func (*SubnetsView) Update added in v0.7.0

func (v *SubnetsView) Update(msg tea.Msg) tea.Cmd

Update handles messages for the subnets view

func (*SubnetsView) View added in v0.7.0

func (v *SubnetsView) View() string

View renders the subnets view

type TableClickDelegate

type TableClickDelegate struct {
	Table *table.Model
}

TableClickDelegate delegates Clickable interface methods to a table.Model. Embed in list views to avoid repeating identical 3-method delegation boilerplate.

func (TableClickDelegate) GetRegions

func (d TableClickDelegate) GetRegions() []mouse.Region

func (TableClickDelegate) HandleRegionClick

func (d TableClickDelegate) HandleRegionClick(regionID string) tea.Cmd

func (TableClickDelegate) UpdateRegions

func (d TableClickDelegate) UpdateRegions(offsetX, offsetY int)

type ToggleFirewallMsg

type ToggleFirewallMsg struct {
	RuleName string
	Disable  bool // true = disable the rule, false = enable it
}

ToggleFirewallMsg is sent when user requests enable/disable toggle

type ToggleServiceAccountMsg

type ToggleServiceAccountMsg struct {
	Email   string
	Disable bool
}

ToggleServiceAccountMsg is sent when user enables/disables a service account

type View

type View interface {
	// Init initializes the view and returns any startup commands
	Init() tea.Cmd

	// Update handles messages and returns any resulting commands
	Update(msg tea.Msg) tea.Cmd

	// View renders the view to a string
	View() string

	// SetContext updates the view with the shared program context.
	// Views should read dimensions from ctx.ContentWidth and ctx.ContentHeight.
	SetContext(ctx *context.ProgramContext)
}

View defines the interface that all gcon views must implement. This enables consistent context propagation and dimension management.

Jump to

Keyboard shortcuts

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