devserver

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package devserver is the `gx dev` loop: build, run, watch, reload (REQ-DEV-01, REQ-DEV-03, REQ-DEV-06, REQ-DEV-07). It is repo tooling and never ships in a production binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectMain

func DetectMain(dir string) (string, error)

DetectMain finds the app main package when none is given.

func Run

func Run(ctx context.Context, opt Options) error

Run runs the dev loop until ctx ends.

Types

type Options

type Options struct {
	// Dir is the app module directory.
	Dir string
	// Main is the main package to build, relative to Dir. Default
	// "./cmd/app", or the only "./cmd/*" directory that holds a main.
	Main string
	// Addr is the address the dev proxy listens on.
	Addr string
	// Log receives the build and run output.
	Log io.Writer
}

Options configures the dev loop.

type Overlay

type Overlay struct {
	Title string `json:"title"`
	Text  string `json:"text"`
	File  string `json:"file,omitempty"`
	Line  int    `json:"line,omitempty"`
	Col   int    `json:"col,omitempty"`
	Link  string `json:"link,omitempty"`
}

Overlay is one compile, type or render error for the browser overlay (REQ-DEV-06).

Jump to

Keyboard shortcuts

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