cmd

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 15 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 cmd converts CLI command-line arguments (-L services, -F chain nodes) into structured config.Config objects. It supports URL-format service and node specifications, metadata query parameters, and auto-detection of handler, listener, dialer, and connector types via the registry.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidCmd is returned when the command-line argument is empty.
	ErrInvalidCmd = errors.New("invalid cmd")
	// ErrInvalidNode is returned when a node specification cannot be parsed.
	ErrInvalidNode = errors.New("invalid node")
)

Functions

func BuildConfigFromCmd

func BuildConfigFromCmd(serviceList, nodeList []string) (*config.Config, error)

BuildConfigFromCmd converts CLI service (-L) and node (-F) arguments into a Config. Each node becomes a hop in a single chain; each service produces a ServiceConfig with auto-detected handler and listener types. Query parameters in the URL are parsed as metadata and routed to the appropriate config sub-struct (handler, listener, hop, connector, dialer, service).

func Norm

func Norm(s string) (*url.URL, error)

Norm normalizes a raw command-line string into a parsed URL. Missing schemes default to "auto" and "https" is rewritten to "http+tls". An empty string returns ErrInvalidCmd.

Types

This section is empty.

Jump to

Keyboard shortcuts

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