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

server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const CoveragePath = "/debug/phpscript/coverage"

CoveragePath is where a running server publishes what it has counted so far.

A profile on disk needs a writable filesystem and a shutdown; a test flow wants the numbers while the server is still up, right after the suite that produced them. The endpoint answers that without either.

View Source
const DefaultDocumentRoot = "public"

DefaultDocumentRoot is the directory beneath an application root served over HTTP when the configuration names none.

View Source
const Name = "Run php server"

Name is the command title.

View Source
const SignalReload = "reload"

SignalReload is the one verb -s takes. nginx also has stop, quit and reopen; the first two are a kill with extra steps, and there are no log files to reopen.

Variables

View Source
var ErrReported = errors.New("reported")

ErrReported ends the process non-zero without a second report: -t and -s have already printed what failed in their own words.

Functions

func Check added in v0.6.0

func Check(filename, root string, out, errOut io.Writer) error

Check is `phpscript -t`: it reports whatever would stop a server starting under filename, writes a verdict, and starts nothing.

func NewCommand

func NewCommand(cfg *config.Config, globals *flags.Options) *cli.Command

NewCommand creates a new server command.

func NewHandler added in v0.2.0

func NewHandler(root fs.FS) (http.Handler, error)

NewHandler serves annotated project routes and files beneath public/.

func Run

func Run(ctx context.Context, args []string, appConfig config.Config, globals *flags.Options) error

Run starts the platform lifecycle and waits for shutdown.

func Signal added in v0.6.0

func Signal(appConfig config.Config, verb string, errOut io.Writer) error

Signal sends verb to the server recorded in server.pid_file.

Types

type Module

type Module struct {
	platform.UnimplementedModule
	// contains filtered or unexported fields
}

Module implements the platform.Module interface.

func NewModule

func NewModule(root, documentRoot string, options runner.Options, flatstack, autoindex bool, observers ...runner.Observer) (*Module, error)

NewModule creates the HTTP module serving one application root.

func (*Module) Mount

func (m *Module) Mount(_ context.Context, r platform.Router) error

Mount registers HTTP routes.

Jump to

Keyboard shortcuts

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