devserver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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