Documentation
¶
Index ¶
- func DeriveAdminURL(shopURL string) string
- func EnvFieldKeys() []string
- func NewApp(ctx context.Context, opts Options) *app.App
- func NewMigrationWizardApp(ctx context.Context, opts Options) *app.App
- func ResolveShopURL(shopURL string, webPort int) string
- type ConfigModel
- func (m *ConfigModel) ApplyPickerValue(field configField, value string) bool
- func (m ConfigModel) ApplyToConfig(cfg *shop.Config)
- func (m ConfigModel) ChangedEnvValues() map[string]string
- func (m ConfigModel) EnvValue(key string) string
- func (m ConfigModel) HandleKey(msg tea.KeyPressMsg) (ConfigModel, tea.Cmd)
- func (m ConfigModel) LocalConfig() *shop.Config
- func (m *ConfigModel) MarkEnvValuesPersisted()
- func (m ConfigModel) PickerForCursor() app.Overlay
- func (m *ConfigModel) SetSize(width, height int)
- func (m ConfigModel) Update(msg tea.Msg) (ConfigModel, tea.Cmd)
- func (m ConfigModel) View(width, height int) string
- type InstanceModel
- func (m *InstanceModel) AddProcessSource(name string, process *executor.Process) tea.Cmd
- func (m *InstanceModel) AddStreamingSource(name string, lineChan <-chan string) tea.Cmd
- func (m *InstanceModel) AppendErrorLine(msg string)
- func (m InstanceModel) Init() tea.Cmd
- func (m *InstanceModel) RemoveSource(name string)
- func (m *InstanceModel) SetSize(width, height int)
- func (m *InstanceModel) StartStreaming() tea.Cmd
- func (m *InstanceModel) StopStreaming()
- func (m InstanceModel) Update(msg tea.Msg) (InstanceModel, tea.Cmd)
- func (m InstanceModel) View() string
- type Model
- type Options
- type OverviewModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveAdminURL ¶
DeriveAdminURL returns the admin URL for the given shop URL by appending the "admin" path segment.
func EnvFieldKeys ¶
func EnvFieldKeys() []string
EnvFieldKeys returns the env variable names this tab manages, suitable for passing to envfile.ReadValues.
func NewMigrationWizardApp ¶
NewMigrationWizardApp hosts the migration-wizard model inside the shell.
func ResolveShopURL ¶
ResolveShopURL rewrites the port in shopURL to webPort, the host port the web container is actually published on. The configured URL is returned unchanged when shopURL is empty, webPort is 0, or shopURL cannot be parsed.
Types ¶
type ConfigModel ¶
type ConfigModel struct {
// contains filtered or unexported fields
}
func NewConfigModel ¶
func NewConfigModel(cfg *shop.Config, envValues map[string]string) ConfigModel
NewConfigModel constructs the Config tab. envValues maps env variable names (see EnvFieldKeys) to the values currently effective in the project's .env files; missing or empty entries fall back to each field's default choice.
func (*ConfigModel) ApplyPickerValue ¶
func (m *ConfigModel) ApplyPickerValue(field configField, value string) bool
func (ConfigModel) ApplyToConfig ¶
func (m ConfigModel) ApplyToConfig(cfg *shop.Config)
func (ConfigModel) ChangedEnvValues ¶
func (m ConfigModel) ChangedEnvValues() map[string]string
ChangedEnvValues returns the env entries whose selected value differs from the value loaded into the model.
func (ConfigModel) EnvValue ¶
func (m ConfigModel) EnvValue(key string) string
EnvValue returns the currently selected value for the env field with the given key, or "" when no such field is registered.
func (ConfigModel) HandleKey ¶
func (m ConfigModel) HandleKey(msg tea.KeyPressMsg) (ConfigModel, tea.Cmd)
func (ConfigModel) LocalConfig ¶
func (m ConfigModel) LocalConfig() *shop.Config
func (*ConfigModel) MarkEnvValuesPersisted ¶
func (m *ConfigModel) MarkEnvValuesPersisted()
MarkEnvValuesPersisted records the current env selections as the new baseline after they have been written to disk.
func (ConfigModel) PickerForCursor ¶
func (m ConfigModel) PickerForCursor() app.Overlay
func (*ConfigModel) SetSize ¶
func (m *ConfigModel) SetSize(width, height int)
func (ConfigModel) Update ¶
func (m ConfigModel) Update(msg tea.Msg) (ConfigModel, tea.Cmd)
Update routes key presses to HandleKey and ignores other messages — the config tab has no background work to react to. Enter (edit/save) is handled one level up in the parent's updateConfigTab before HandleKey is reached.
func (ConfigModel) View ¶
func (m ConfigModel) View(width, height int) string
type InstanceModel ¶
type InstanceModel struct {
// contains filtered or unexported fields
}
func NewInstanceModel ¶
func NewInstanceModel(ctx context.Context, projectRoot string, dockerMode bool) InstanceModel
func (*InstanceModel) AddProcessSource ¶
func (*InstanceModel) AddStreamingSource ¶
func (m *InstanceModel) AddStreamingSource(name string, lineChan <-chan string) tea.Cmd
AddStreamingSource registers a log source backed by an externally fed line channel (e.g. a watcher's preparation steps) and starts displaying it live.
func (*InstanceModel) AppendErrorLine ¶
func (m *InstanceModel) AppendErrorLine(msg string)
func (InstanceModel) Init ¶
func (m InstanceModel) Init() tea.Cmd
func (*InstanceModel) RemoveSource ¶
func (m *InstanceModel) RemoveSource(name string)
RemoveSource stops the named source's stream and drops it from the sidebar, e.g. when a watcher is stopped. The active/cursor selection is kept valid and moved to a neighbouring source, re-rendering its buffer if the removed source was the active one.
func (*InstanceModel) SetSize ¶
func (m *InstanceModel) SetSize(width, height int)
func (*InstanceModel) StartStreaming ¶
func (m *InstanceModel) StartStreaming() tea.Cmd
func (*InstanceModel) StopStreaming ¶
func (m *InstanceModel) StopStreaming()
func (InstanceModel) Update ¶
func (m InstanceModel) Update(msg tea.Msg) (InstanceModel, tea.Cmd)
func (InstanceModel) View ¶
func (m InstanceModel) View() string
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewMigrationWizard ¶
NewMigrationWizard creates a Model that starts in the migration wizard phase for projects that don't yet have a development environment configured.
type Options ¶
type Options struct {
ProjectRoot string
// ConfigPath is the path of the project configuration file; port overrides
// are persisted to its local override sibling.
ConfigPath string
Config *shop.Config
EnvConfig *shop.EnvironmentConfig
Executor executor.Executor
// ProxyFallback is set when a proxy project could not start the shared
// proxy and dev fell back to fixed host ports. The shop is then reachable
// at the local port URL, not the (now unrouted) proxy hostname in Config.
ProxyFallback bool
}
type OverviewModel ¶
type OverviewModel struct {
// contains filtered or unexported fields
}
Receiver convention for the tab models (Overview, Instance, Config): methods that return the model (Update/handleKey/activate/View and other pure reads) use value receivers; methods that mutate the model in place and return nothing or only a tea.Cmd (SetSize, start*/stop* streaming helpers) use pointer receivers.
func NewOverviewModel ¶
func (OverviewModel) Init ¶
func (m OverviewModel) Init() tea.Cmd
func (*OverviewModel) SetSize ¶
func (m *OverviewModel) SetSize(width, height int)
func (OverviewModel) Update ¶
func (m OverviewModel) Update(msg tea.Msg) (OverviewModel, tea.Cmd)
func (OverviewModel) View ¶
func (m OverviewModel) View(width, height int) string
Source Files
¶
- compose.go
- install_failure.go
- install_wizard.go
- lifecycle.go
- migration_wizard.go
- migration_wizard_apply.go
- migration_wizard_view.go
- model.go
- model_commands.go
- model_update.go
- model_view.go
- overlay_palette.go
- overlay_port_conflict.go
- overlay_sales_channel_picker.go
- overlay_stop_confirm.go
- styles.go
- tab_config.go
- tab_instance.go
- tab_overview.go
- tab_overview_health.go
- task_runner.go
- telemetry.go