dev

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveAdminURL

func DeriveAdminURL(shopURL string) string

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 NewApp

func NewApp(ctx context.Context, opts Options) *app.App

NewApp hosts the dashboard model inside the application shell.

func NewMigrationWizardApp

func NewMigrationWizardApp(ctx context.Context, opts Options) *app.App

NewMigrationWizardApp hosts the migration-wizard model inside the shell.

func ResolveShopURL

func ResolveShopURL(shopURL string, webPort int) string

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 (m *InstanceModel) AddProcessSource(name string, process *executor.Process) tea.Cmd

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 New

func New(ctx context.Context, opts Options) Model

func NewMigrationWizard

func NewMigrationWizard(ctx context.Context, opts Options) Model

NewMigrationWizard creates a Model that starts in the migration wizard phase for projects that don't yet have a development environment configured.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (app.Content, tea.Cmd)

func (Model) View

func (m Model) View(ctx app.Context) string

View renders the main region (the content box between the shell's header and footer chrome).

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 NewOverviewModel(ctx context.Context, envType, shopURL, username, password, projectRoot string, exec executor.Executor, shopCfg *shop.Config) OverviewModel

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

Jump to

Keyboard shortcuts

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