serve

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: 0BSD Imports: 9 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 serve is the command-line front end shared by the worker and the recipes binary: it parses the transport and logging flags and runs a *vgi.Worker on the transport they select. The SDK does not parse argv.

(no flags)                    stdio: what DuckDB launches by default
--http [--host H] [--port N]  HTTP; prints PORT:<n> on stdout once listening
--unix PATH                   AF_UNIX socket (DuckDB's launch: transport);
                              prints UNIX:<path> on stdout once listening

Logging goes to stderr: --debug, --log-level, --log-format, --log-logger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(name string, args []string, build func() *vgi.Worker)

Main parses args (normally os.Args[1:]), builds the worker and serves it. Errors go to stderr with exit status 2 (bad flags) or 1 (serve failure).

func Run

func Run(w *vgi.Worker, o Options) error

Run serves w on the transport o selects, blocking until it stops.

Types

type Options

type Options struct {
	HTTP        bool
	Host        string
	Port        int
	Unix        string
	IdleTimeout time.Duration
}

Options are the parsed command-line flags.

func Parse

func Parse(name string, args []string, stderr io.Writer) (Options, error)

Parse parses args (normally os.Args[1:]) and applies the logging flags.

DuckDB's launcher may add flags this binary doesn't know (it varies argv to build distinct pool keys), so unknown flags are ignored rather than fatal.

Jump to

Keyboard shortcuts

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