config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 35 Imported by: 2

Documentation

Overview

Package config loads standalone configuration without opening listeners or databases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheInvalidation added in v1.1.0

type CacheInvalidation struct {
	TimeoutMs int64
	Admin     *gateway.DocumentAccess
}

type CacheProvider

type CacheProvider struct {
	spec.CacheSettings
	Enabled *bool `json:"enabled,omitempty"`
}

CacheProvider is the legacy CacheProviders list entry. Legacy definitions predate Enabled, so an omitted flag enables the provider; explicit false wins.

type Config

type Config struct {
	// ConstURL identifies one trusted flat YAML/JSON instance constant mapping.
	ConstURL string
	Const    *constant.Values `json:"-"`
	gateway.Config
	URL               string `json:"-"`
	Version           string
	Endpoint          Endpoint
	Info              *openapi3.Info
	GoBootstrap       *Packages
	Warmup            *Warmup
	CacheInvalidation *CacheInvalidation
	Observation       *Observation
	// BaseDir and ModuleDirs locate trusted local source modules. Package selection
	// retains original GoBootstrap names; discovery is owned by transcribe.
	BaseDir    string
	ModuleDirs []string
	Connector  string
	Connectors []connector.Config
	// Caches supplies named reader services. CacheProviders accepts legacy dependency documents.
	Caches         map[string]*spec.CacheSettings
	CacheProviders []*CacheProvider
	JWTValidator   *verifier.Config
	JwtSigner      *signer.Config
	Cognito        *cognito.Config
	Firebase       *firebase.Config
	JWTClaims      *auth.ClaimPolicy
	MCP            *MCP
	RouteURL       string
	PluginsURL     string
	DependencyURL  string
	Jobs           *Jobs
	JobURL         string
	FailedJobURL   string
	MaxJobs        int
}

func (*Config) ResolveConstants

func (c *Config) ResolveConstants() (*Config, error)

ResolveConstants stages only fields whose owners access paths or URLs. It retains the caller's configuration and root handles without widening authority. The returned configuration is a server-lifetime access plan, never persisted.

func (*Config) Validate

func (c *Config) Validate() error

type Endpoint

type Endpoint struct {
	Port int
	// Address is an explicit listener override, including port zero for OS allocation.
	Address             string
	ReadTimeoutMs       int
	ReadHeaderTimeoutMs int
	IdleTimeoutMs       int
	WriteTimeoutMs      int
	MaxHeaderBytes      int
	ShutdownTimeoutMs   int
}

func (Endpoint) ListenAddress

func (e Endpoint) ListenAddress() (string, error)

func (Endpoint) ShutdownTimeout

func (e Endpoint) ShutdownTimeout() time.Duration

type Jobs

type Jobs struct {
	Connector            string
	Table                string
	Dataset              string
	DisableTableCreation bool
	Notification         xasync.Notification
	TTLSeconds           int64
	ErrorTTLSeconds      int64
	PollIntervalMs       int64
}

Jobs selects the existing application job services. Authorization is supplied by the linked standalone host, never inferred from serialized configuration. Connector/table selection is fixed for the server's lifetime.

type Loader

type Loader struct {
	// ConstURL overrides the config file selection; its relative path is process-relative.
	ConstURL string
	FS       afs.Service
	// StaticLocalRoot grants an independently selected, caller-owned authority for
	// local ContentURL paths. Such paths stay relative to this handle, not the
	// config file. The caller keeps it open for the server's reload lifetime.
	StaticLocalRoot *os.Root
}

func (Loader) Load

func (l Loader) Load(ctx context.Context, location string) (*Config, error)

type MCP

type MCP struct {
	Folders       []resource.Folder
	Port          *int
	Address       string
	Authorization *authorization.Policy
}

func (MCP) ListenAddress

func (m MCP) ListenAddress() (string, error)

type OTel

type OTel struct {
	Enabled                         bool
	QueueSize, BatchSize, MaxSpans  int
	BatchTimeoutMs, ExportTimeoutMs int64
	ServiceName, ServiceVersion     string
	IncludeSQL                      bool
	HTTP                            otel.HTTPExporter
}

type Observation

type Observation struct {
	LogSummaries bool
	OTel         *OTel
}

Observation configures the existing native capture owner. Logging summaries is independent of OTel; neither option disables native Datly capture.

type Packages

type Packages struct {
	Packages, Exclude []string
	// EagerComponents explicitly opts into compiling every selected component
	// at startup, for example when exporting complete OpenAPI schemas.
	EagerComponents bool
}

type Warmup

type Warmup struct {
	TimeoutMs int64
	Admin     *gateway.DocumentAccess
}

Jump to

Keyboard shortcuts

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