repl

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package repl implements Vinculum's interactive read-eval-print loop, reached via "vinculum serve -i". After normal server startup it presents a prompt at which the user types VCL expressions evaluated against the live, running configuration. 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 struct {
	// contains filtered or unexported fields
}

Session holds the state of a single interactive REPL run.

func New

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

New constructs a REPL session. The caller is responsible for having already performed normal server startup; New does not start or stop anything.

func (*Session) Run

func (s *Session) Run() error

Run drives the read-eval-print loop on the calling (foreground) goroutine. It returns when the user exits (EOF / :quit) or SIGTERM is received. The caller should run the shared shutdown sequence afterward.

Jump to

Keyboard shortcuts

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