composeedit

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package composeedit provides the embedded editor for compose files, with YAML syntax validation before saving.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateYAML

func ValidateYAML(content string) error

ValidateYAML reports whether content is syntactically valid YAML.

Types

type Model

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

Model is the compose-file editor.

func New

func New() Model

New builds an empty editor.

func (Model) CreateDir

func (m Model) CreateDir() string

CreateDir returns the target directory for a new project.

func (Model) IsCreate

func (m Model) IsCreate() bool

IsCreate reports whether the editor is authoring a new project.

func (Model) Path

func (m Model) Path() string

Path returns the compose file path being edited.

func (Model) Project

func (m Model) Project() string

Project returns the project being edited.

func (*Model) SetContent

func (m *Model) SetContent(project, path, content string) tea.Cmd

SetContent loads a project's compose file into the editor and focuses it.

func (*Model) SetCreate

func (m *Model) SetCreate(dir string) tea.Cmd

SetCreate opens the editor to author a new docker-compose.yaml in dir, pre-filled with a starter template.

func (*Model) SetError

func (m *Model) SetError(s string)

SetError shows a message under the editor (e.g. validation failure).

func (*Model) SetSaving

func (m *Model) SetSaving(v bool)

SetSaving toggles the "saving…" indicator.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize resizes the editing area, leaving room for title/footer lines.

func (Model) Update

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

Update forwards events to the textarea.

func (Model) Value

func (m Model) Value() string

Value returns the current editor text.

func (Model) View

func (m Model) View(width int) string

View renders the editor with a title, the text area, and a status line.

Jump to

Keyboard shortcuts

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