daemon

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 12 Imported by: ? 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 daemon starts a local Directory daemon (`dirctl daemon start`, run in-process) next to the MCP server, so the tools have a Directory node to talk to without any manual setup.

Index

Constants

View Source
const (
	// EnvDisable turns off the automatic daemon when set to "false", "0" or "off".
	EnvDisable = "DIR_MCP_DAEMON"
)

Variables

View Source
var ErrAddressInUse = errors.New("directory server address is already in use")

ErrAddressInUse is returned by Start when another server keeps holding the configured Directory address.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	// contains filtered or unexported fields
}

Daemon is a Directory daemon running in this process.

func Start

func Start(ctx context.Context) (*Daemon, error)

Start launches a local Directory daemon when one is needed and returns it. It returns (nil, nil) when nothing was started: the feature is disabled or the configured server is not local. If another server holds the address, Start waits up to 30 seconds for it (and its locks) to go away and then fails with ErrAddressInUse. The caller must Stop a non-nil Daemon.

The daemon is the dirctl `daemon start` command, run in-process. It logs to os.Stdout, so callers that use stdout for a protocol stream must point os.Stdout elsewhere before calling Start.

func (*Daemon) Stop

func (d *Daemon) Stop()

Stop shuts the daemon down and waits for it to exit. Safe on a nil Daemon.

Jump to

Keyboard shortcuts

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