repl

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package repl wires Vinculum's live configuration into the generic functy REPL engine (github.com/tsarna/functy/repl), reached via "vinculum serve -i". After normal server startup it presents a prompt at which the user types VCL expressions evaluated against the running configuration. The generic loop, result history, bindings, completion, and formatting live in the engine; this package supplies the Vinculum host adapter (see host.go: the per-eval `ctx` object, trace span, reserved-name policy, and log-control meta-commands) plus the interactive log sink (logsink.go). Exiting the REPL shuts the server down.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logging

type Logging struct {
	// Logger is the base logger handed to the ConfigBuilder via WithLogger.
	Logger *zap.Logger
	// contains filtered or unexported fields
}

Logging bundles the interactive-mode logger with the handles the REPL needs to manage it: the swappable destination sink and the atomic level that the :loglevel / :quiet / :logs meta-commands manipulate.

func NewInteractiveLogging

func NewInteractiveLogging(level zapcore.Level) *Logging

NewInteractiveLogging builds the logger used in interactive mode: a console encoder (human-readable + color) writing through zapcore.Lock(sink) at a runtime-adjustable level. The sink starts pointed at os.Stderr (before the line editor exists). Both Config.Logger and Config.UserLogger inherit this sink and level because they derive from this single base logger.

type Session

type Session = engine.Session

Session is the interactive REPL session; it is the generic engine session driven by the Vinculum host. Callers invoke Run to drive the loop.

func New

func New(cfg *config.Config, logging *Logging, configPaths []string) *Session

New constructs a REPL session over a live vinculum Config. The caller is responsible for having already performed normal server startup; New does not start or stop anything. Exiting Run should be followed by the shared shutdown.

Jump to

Keyboard shortcuts

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