devtool

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Stdin     io.Reader
	Stdout    io.Writer
	Stderr    io.Writer
	Resolve   func(context.Context) (Environment, error)
	Database  DatabaseManager
	Ports     PortAllocator
	Processes ProcessManager
}

App implements the command interface used by mise tasks.

func NewApp

func NewApp() *App

func (*App) Run

func (a *App) Run(ctx context.Context, args []string) error

type DatabaseCloneResult

type DatabaseCloneResult struct {
	Replaced bool
}

DatabaseCloneResult reports whether a clone installed the replacement before returning an error during cleanup.

type DatabaseManager

DatabaseManager owns the shared PostgreSQL process and its worktree databases.

type DockerDatabase

type DockerDatabase struct{}

DockerDatabase manages PostgreSQL through the main worktree's Compose service.

func (*DockerDatabase) Clone

func (d *DockerDatabase) Clone(ctx context.Context, env Environment, source, target string) (result DatabaseCloneResult, returnErr error)

func (*DockerDatabase) Create

func (d *DockerDatabase) Create(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) Exists

func (d *DockerDatabase) Exists(ctx context.Context, env Environment, name string) (bool, error)

func (*DockerDatabase) Migrate

func (d *DockerDatabase) Migrate(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) RequireRunning

func (d *DockerDatabase) RequireRunning(ctx context.Context, env Environment) error

func (*DockerDatabase) Reset

func (d *DockerDatabase) Reset(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) Rollback

func (d *DockerDatabase) Rollback(ctx context.Context, env Environment, name string) error

func (*DockerDatabase) Start

func (d *DockerDatabase) Start(ctx context.Context, env Environment) error

type Environment

type Environment struct {
	MainRoot        string
	CurrentRoot     string
	MainDatabase    string
	CurrentDatabase string
	PostgresPort    int
	ProjectName     string
}

Environment describes the repository and worktree resources used by a command.

func ResolveEnvironment

func ResolveEnvironment(ctx context.Context) (Environment, error)

func (Environment) CurrentFilesPath

func (e Environment) CurrentFilesPath() string

func (Environment) DatabaseURL

func (e Environment) DatabaseURL(name string) string

func (Environment) IsMain

func (e Environment) IsMain() bool

func (Environment) MainFilesPath

func (e Environment) MainFilesPath() string

type FilePortAllocator

type FilePortAllocator struct {
	LockRoot string
}

FilePortAllocator coordinates ports between worktrees with advisory locks.

func (*FilePortAllocator) Acquire

func (a *FilePortAllocator) Acquire(preferred int) (PortLease, error)

type OSProcesses

type OSProcesses struct{}

OSProcesses runs development commands as child process groups.

func (*OSProcesses) E2E

func (p *OSProcesses) E2E(ctx context.Context, env Environment, project string, webPort int) error

func (*OSProcesses) Start

func (p *OSProcesses) Start(ctx context.Context, env Environment, mode string, apiPort, webPort int) error

type PortAllocator

type PortAllocator interface {
	Acquire(preferred int) (PortLease, error)
}

PortAllocator reserves the first available port at or above a preferred port.

type PortLease

type PortLease interface {
	Port() int
	Close() error
}

PortLease reserves a runtime port until Close is called.

type ProcessManager

type ProcessManager interface {
	Start(context.Context, Environment, string, int, int) error
	E2E(context.Context, Environment, string, int) error
}

ProcessManager runs the development servers and browser tests.

Jump to

Keyboard shortcuts

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