config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 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 config loads the gateway settings: an optional YAML file (flag --config) overridden by environment variables, checked at start.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadUpstreams

func LoadUpstreams(path string) ([]upstream.Server, error)

LoadUpstreams reads only the list of upstream servers from the YAML file. edigatectl uses it to pin the tools of a server without the rest of the gateway settings.

Types

type Config

type Config struct {
	DBURL  string `yaml:"db_url"`
	Listen string `yaml:"listen"`

	// The quarantined reader (an OpenAI-compatible API). An empty model switches
	// edi.extract_note off: it answers quarantine_invalid and the rest works.
	QuarantineBaseURL string `yaml:"quarantine_base_url"`
	QuarantineModel   string `yaml:"quarantine_model"`
	QuarantineAPIKey  string `yaml:"quarantine_api_key"`

	// The relay that delivers the outbox to the ERP. An empty OnecURL switches it
	// off: orders are reserved and stay queued. TimeScale divides the retry pauses.
	OnecURL      string  `yaml:"onec_url"`
	RelayWorkers int     `yaml:"relay_workers"`
	TimeScale    float64 `yaml:"time_scale"`

	// The warehouse and the trading partner the sagas deliver to. An empty WMSURL leaves the
	// warehouse effects queued; an empty PartnerURL leaves the documents for the partner queued.
	WMSURL     string `yaml:"wms_url"`
	PartnerURL string `yaml:"partner_url"`

	// Stand settings of the benchmark slots (protocol section 6). PublicURL is the address at which the
	// partner emulator reaches this process; the gateway sends it in the header Edigate-Reply-To, so
	// that the 997 of a document comes back to the process that sent it. TransportLog is a file that
	// gets one JSON line for every MCP request. Both are empty outside the benchmark.
	PublicURL    string `yaml:"public_url"`
	TransportLog string `yaml:"transport_log"`

	// The upstream MCP servers the gateway may pass tools of on (flow P8), the public key
	// (base64, ed25519) that verifies their pinned descriptions, and the up.* tools each
	// tenant may call (data of the policy; empty means none). Without servers there are no
	// up.* tools. Servers without a key are switched off at start (see upstream.New).
	Upstreams      []upstream.Server   `yaml:"upstreams"`
	ManifestPubKey string              `yaml:"manifest_pubkey"`
	UpstreamAllow  map[string][]string `yaml:"upstream_allow"`

	// The key (base64 ed25519, environment only) that signs the anchors of the audit chain, and
	// the directory outside the database where the anchors are also written. Without a key the
	// chain is written but there are no anchors; without a directory the anchors stay in the database.
	AuditSigningKey string `yaml:"-"`
	AuditAnchorDir  string `yaml:"audit_anchor_dir"`

	// Fault injection for tests of the guarantee only (see .env.example). Off by
	// default; read from the environment only.
	ChaosExitBeforeSend float64       `yaml:"-"`
	ChaosExitAfterApply float64       `yaml:"-"`
	ChaosCrashAfter     time.Duration `yaml:"-"`
	ChaosSeed           *uint64       `yaml:"-"`
}

Config is everything the gateway needs to start in this version.

func Load

func Load(path string) (Config, error)

Load reads the YAML file when path is not empty, applies the EDIGATE_* variables over it, fills defaults and checks the result.

Jump to

Keyboard shortcuts

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