Documentation
¶
Overview ¶
Package browser implements the interactive Darkube browser.
Index ¶
- func RunBrowser(ctx context.Context, options Options) error
- func RunMockBrowser(ctx context.Context, profile MockProfile, version string, allowSecrets bool) error
- type AppUsage
- type DomainConfig
- type MockAppData
- type MockLog
- type MockProfile
- type MockRegistry
- type MockRegistryImage
- type MockTenant
- type Options
- type PortConfig
- type ResourceConfig
- type UsageHistory
- type UsageMetricFailures
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunBrowser ¶
RunBrowser opens the app browser using the caller's scoped clients.
func RunMockBrowser ¶
func RunMockBrowser(ctx context.Context, profile MockProfile, version string, allowSecrets bool) error
RunMockBrowser opens a browser backed only by the supplied local fixture.
Types ¶
type AppUsage ¶
type AppUsage struct {
CPUCores *float64
RAMBytes *float64
DiskBytes *float64
Failed UsageMetricFailures
}
AppUsage is an optional latest resource snapshot, in CPU cores and bytes.
type DomainConfig ¶
type DomainConfig struct {
Hosts []string
Subdomain string
BaseDomain string
CNAME string
Challenge string
SSL bool
RedirectHTTPS bool
HTTP2 bool
DNS map[string]bool
Certificates map[string]string
ChallengeRecords map[string]string
ChallengeRecordsFailed bool
}
DomainConfig is the verified app ingress configuration editable in the TUI.
type MockAppData ¶
type MockAppData struct {
PlainEnvs []client.EnvVar
SecretNames []string
Pods []appstate.Pod
Logs []MockLog
Usage *AppUsage
History UsageHistory
}
MockAppData contains offline application fixture data.
type MockProfile ¶
type MockProfile struct {
Tenant string
Apps []client.App
Alerts []client.Alert
Namespaces []client.Namespace
Tenants []MockTenant
AppData map[string]MockAppData
Registries []MockRegistry
Databases []client.Database
Storages []client.Storage
}
MockProfile contains the local-only fields rendered by the fixture browser.
func LoadMockProfile ¶
func LoadMockProfile(path string) (MockProfile, error)
LoadMockProfile reads a bounded, versioned YAML fixture. Unknown fields fail parsing so secrets and unsupported data cannot silently enter the UI model.
func ParseMockProfile ¶
func ParseMockProfile(data []byte) (MockProfile, error)
ParseMockProfile decodes one strict YAML document without exposing parser snippets, which can contain values copied into a malformed fixture.
type MockRegistry ¶
type MockRegistry struct {
Registry client.Registry
Images []MockRegistryImage
}
MockRegistry contains an offline registry fixture.
type MockRegistryImage ¶
type MockRegistryImage struct {
Repository client.Repository
Digests []client.Digest
}
MockRegistryImage contains an offline registry image fixture.
type MockTenant ¶
type MockTenant struct {
Name string
Apps []client.App
Alerts []client.Alert
Namespaces []client.Namespace
AppData map[string]MockAppData
Registries []MockRegistry
Databases []client.Database
Storages []client.Storage
}
MockTenant is one tenant and its local app snapshot.
type Options ¶
type Options struct {
Tenant string
Version string
LocalTenants []string
AllowWrites bool
AllowSecrets bool
ListStorages func(context.Context, string) ([]client.Storage, error)
GetStoragePlans func(context.Context, string) (map[string]client.StoragePlanAllowance, error)
GetStorageTraffic func(context.Context, string, string) ([]client.StorageTrafficSample, error)
CreateStorageBucket func(context.Context, string, string, string) (string, error)
DeleteStorageBucket func(context.Context, string, string, string) error
SetStorageBucketPublic func(context.Context, string, string, bool, string) error
CreateStorageKey func(context.Context, string, string, []string, []string, string) (*client.StorageKeySecret, error)
UpdateStorageKey func(context.Context, string, string, []string, []string, string) error
RotateStorageKey func(context.Context, string, string, string) (*client.StorageKeySecret, error)
DeleteStorageKey func(context.Context, string, string, string) error
ListTickets func(context.Context, string, string, bool) (client.TicketList, error)
GetTicket func(context.Context, string, string) (client.Ticket, error)
GetTicketComments func(context.Context, string, string) ([]client.TicketComment, error)
GetTicketCategories func(context.Context, string) ([]client.TicketCategory, error)
GetTicketPriorities func(context.Context, string) ([]client.TicketPriority, error)
CreateTicket func(context.Context, string, client.NewTicket) (string, error)
ReplyTicket func(context.Context, string, string, string) error
Profile func(context.Context) (*client.Profile, error)
Alerts func(context.Context, string) ([]client.Alert, error)
Notifications func(context.Context) ([]client.Notification, error)
ListDatabases func(context.Context, string) ([]client.Database, error)
GetDatabase func(context.Context, string, string) (*client.DatabaseDetail, error)
ListApps func(context.Context, string) ([]client.App, error)
GetApp func(context.Context, string, string) (*client.App, error)
Usage func(context.Context, string, string) (*AppUsage, error)
ListPVCs func(context.Context, string, string, int) ([]client.PVC, error)
UsageHistory func(context.Context, string, string, time.Duration, time.Duration) (*UsageHistory, error)
Pods func(context.Context, string, string) ([]appstate.Pod, error)
AppLogs func(context.Context, string, string, client.LogOptions) ([]client.LogEntry, error)
ListBuilds func(context.Context, string, string, int) ([]client.Build, error)
GetBuild func(context.Context, string, client.BuildID) (*client.Build, error)
DeployToken func(context.Context, string, string) (string, error)
UpdateGitBuildSettings func(context.Context, string, string, client.GitBuildSettings, client.GitBuildSettings) error
BuildLatest func(context.Context, string, string) error
RetryBuild func(context.Context, string, client.BuildID) (*client.Build, error)
StopBuild func(context.Context, string, client.BuildID) error
Environment func(context.Context, string, string) ([]client.EnvVar, []string, error)
SecretEnvs func(context.Context, string, string) ([]client.EnvVar, error)
UpdatePlainEnv func(context.Context, string, string, []client.EnvVar) error
UpdateSecretEnv func(context.Context, string, string, []client.EnvVar) error
Domains func(context.Context, string, string) (DomainConfig, error)
UpdateDomains func(context.Context, string, string, DomainConfig) error
Ports func(context.Context, string, string) (PortConfig, error)
UpdatePorts func(context.Context, string, string, PortConfig) error
UpdateResources func(context.Context, string, string, ResourceConfig) error
ListResourcePlans func(context.Context, string) ([]client.Plan, error)
Terminal func(context.Context, string, string, string, string, string) tea.ExecCommand
EgressRoutes func(context.Context, string) (map[string]client.ClusterEgress, error)
Namespaces func(context.Context, string) ([]client.Namespace, error)
ListRegistries func(context.Context, string) ([]client.Registry, error)
ListRegistryRepositories func(context.Context, string, client.FlexID) ([]client.Repository, error)
ListRegistryDigests func(context.Context, string, client.FlexID, string) ([]client.Digest, error)
DeleteRegistryRepository func(context.Context, string, client.FlexID, string) error
DeleteRegistryDigests func(context.Context, string, client.FlexID, string, []string) error
DeleteRegistryTags func(context.Context, string, client.FlexID, string, string, []string) error
RestartApp func(context.Context, string, string) error
DeleteApp func(context.Context, string, string) error
}
Options contains the live browser's reads and opt-in write actions.
type PortConfig ¶
type PortConfig struct {
Type string
InternalAddress string
ExternalAddress string
ExternalIP string
Ports map[string]client.Port
}
PortConfig is the editable service projection for an app.
type ResourceConfig ¶
type ResourceConfig struct {
Plan, CPU, RAM string
DiskGi, Replicas, MinReplicas, MaxReplicas, CPUTarget int
Autoscaling bool
}
ResourceConfig is the staged, editable resource and scaling projection.
Source Files
¶
- actions.go
- actions_view.go
- activity.go
- app_navigation.go
- apps.go
- browser.go
- build_output.go
- builds.go
- cicd_settings.go
- common_strings.go
- context.go
- db.go
- diagnostic_wrap.go
- domains.go
- egress.go
- env.go
- focus.go
- history_chart.go
- keys.go
- layout.go
- loaders.go
- logs.go
- message_errors.go
- messages.go
- mock.go
- mock_profile.go
- model.go
- mouse.go
- namespaces.go
- overlay_keys.go
- overlays.go
- pane_message.go
- pods.go
- ports.go
- registry.go
- request_registry.go
- request_state.go
- resources.go
- results.go
- scaling.go
- storage.go
- storage_credentials.go
- storage_details.go
- storage_export.go
- storage_forms.go
- storage_keys.go
- storage_mutations.go
- storage_tree.go
- styles.go
- summary.go
- terminal.go
- tickets.go
- time_format.go
- tree.go
- update.go
- usage.go
- usage_history.go
- write_gate.go