Help us shape the future of Go! Take the 2026 Go Developer Survey

devserver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package devserver manages .dev/server, the Umono project that umono theme dev runs a theme project with.

Index

Constants

View Source
const (
	Username = "admin"
	Password = "admin"
)

Username and Password are the account of .dev/server.

Variables

View Source
var ErrCLIOutdated = errors.New("the CLI is outdated")

ErrCLIOutdated is returned when no theme the CLI builds works with the runtime of .dev/server.

Functions

func CheckThemeAPI

func CheckThemeAPI(projectDir string) (string, error)

CheckThemeAPI compares the Theme API range in the umono.json of .dev/server with the CLI's themecore. The same range returns nothing. A runtime whose theme_api_min is above the CLI's ThemeAPICurrent runs no theme the CLI builds: ErrCLIOutdated. Any other difference is a warning.

func Dir

func Dir(projectDir string) string

Dir is .dev/server of the theme project projectDir.

func Ensure

func Ensure(projectDir string, client *download.Client) (bool, error)

Ensure sets .dev/server up when it has no umono.json: an empty Umono project of the latest release of client, with the account admin/admin. It is set up in a temporary directory next to it and renamed into place, so a failed setup leaves nothing. A .dev/server without a valid umono.json is not touched: it may hold the theme author's umono.db. It reports whether it set the server up.

func Update

func Update(projectDir string, client *download.Client) error

Update runs the flow of umono upgrade on .dev/server: its binary and umono.json are replaced with those of the latest release of client, and umono.db is kept. Installed themes do not stop it: the only theme of .dev/server is dev/dev, which upgrade skips.

Types

type Server

type Server struct {
	// URL is where it listens, http://127.0.0.1:{port}.
	URL string
	// contains filtered or unexported fields
}

Server is a running .dev/server.

func Start

func Start(projectDir string) (*Server, error)

Start starts the binary of .dev/server in its directory on a free port, which the CLI picks on every start, with UMONO_THEME_DEV set to the absolute path of projectDir: Umono opens its dev mode only with it. The server's output goes to .dev/server/umono.log. Start returns when the server listens. A server that exits before shows the end of its log.

func (*Server) Stop

func (s *Server) Stop() error

Stop interrupts the server and kills it after stopTimeout. It can be called more than once.

Jump to

Keyboard shortcuts

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