Help us shape the future of Go! Take the 2026 Go Developer Survey

settings

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package settings adapts the public catalog configuration to Starmap commands.

Index

Constants

View Source
const (
	Prefix                                  = catalogconfig.Prefix
	AuthorityOrigin                         = catalogconfig.AuthorityOrigin
	Source                                  = catalogconfig.Source
	SourceURL                               = catalogconfig.SourceURL
	SourceAPIKey                            = catalogconfig.SourceAPIKey
	SourceRepository                        = catalogconfig.SourceRepository
	SourceChannel                           = catalogconfig.SourceChannel
	SourceSignerWorkflow                    = catalogconfig.SourceSignerWorkflow
	SourceToken                             = catalogconfig.SourceToken
	SourceRefreshMode                       = catalogconfig.SourceRefreshMode
	GenerationPin                           = catalogconfig.GenerationPin
	RetentionEnabled                        = catalogconfig.RetentionEnabled
	RetentionInterval                       = catalogconfig.RetentionInterval
	RetentionMaxGenerations                 = catalogconfig.RetentionMaxGenerations
	RetentionMaxBytes                       = catalogconfig.RetentionMaxBytes
	RetentionScanEntries                    = catalogconfig.RetentionScanEntries
	RetentionInputMaxBytes                  = catalogconfig.RetentionInputMaxBytes
	NetworkMode                             = catalogconfig.NetworkMode
	SourcePollInterval                      = catalogconfig.SourcePollInterval
	SourceStartupPolicy                     = catalogconfig.SourceStartupPolicy
	SourceAuthorityID                       = catalogconfig.SourceAuthorityID
	SourcePolicyID                          = catalogconfig.SourcePolicyID
	SourceMaxAge                            = catalogconfig.SourceMaxAge
	SourceMaxHops                           = catalogconfig.SourceMaxHops
	SourceAliases                           = catalogconfig.SourceAliases
	AcquisitionSources                      = catalogconfig.AcquisitionSources
	ModelsDevGitCommit                      = catalogconfig.ModelsDevGitCommit
	AcquisitionEnabled                      = catalogconfig.AcquisitionEnabled
	AcquisitionInterval                     = catalogconfig.AcquisitionInterval
	ProviderBindings                        = catalogconfig.ProviderBindings
	CoalesceWindow                          = catalogconfig.CoalesceWindow
	WorkspacePath                           = catalogconfig.WorkspacePath
	StartupSpread                           = catalogconfig.StartupSpread
	TransferIdleTimeout                     = catalogconfig.TransferIdleTimeout
	TransferMaxDuration                     = catalogconfig.TransferMaxDuration
	RefreshTimeout                          = catalogconfig.RefreshTimeout
	StateDirectory                          = catalogconfig.StateDirectory
	SchedulerIdentity                       = catalogconfig.SchedulerIdentity
	PermissionClockSource                   = catalogconfig.PermissionClockSource
	PermissionClockRefreshInterval          = catalogconfig.PermissionClockRefreshInterval
	PermissionClockMaxAge                   = catalogconfig.PermissionClockMaxAge
	PermissionClockMaxDriftPPM              = catalogconfig.PermissionClockMaxDriftPPM
	PermissionClockCounterUncertainty       = catalogconfig.PermissionClockCounterUncertainty
	PermissionClockWindowsMaxSourceAge      = catalogconfig.PermissionClockWindowsMaxSourceAge
	PermissionClockWindowsMaxSourceDriftPPM = catalogconfig.PermissionClockWindowsMaxSourceDriftPPM
	PermissionClockWindowsSourceUncertainty = catalogconfig.PermissionClockWindowsSourceUncertainty
)

Canonical names remain available to application composition.

Variables

This section is empty.

Functions

func Flags

func Flags() []string

Flags returns the canonical command flags.

func Names

func Names() []string

Names returns the canonical environment names.

func RegisterFlags

func RegisterFlags(flags *pflag.FlagSet) error

RegisterFlags registers one string flag for every canonical catalog setting. A flag carries the kebab-case name of its setting. A flag value follows the same grammar as the environment value, so one parser reads both.

Types

type Composition

type Composition struct {
	// Config holds the canonical settings the process read.
	Config Config

	// Source supplies an upstream source implementation. It overrides the
	// source that the settings select, so a test injects a hermetic source.
	Source runtime.Source

	// Acquirer collects provider observations. A runtime without one observes
	// no provider.
	Acquirer runtime.Acquirer

	// LeaseStore fences the durable generation commit of a replicated
	// deployment. A single instance needs none.
	LeaseStore runtime.LeaseStore

	// OriginStore supplies the selected catalog store for an explicit origin declaration.
	// Composition constructs no store and starts no storage I/O.
	OriginStore storage.Store

	// Base holds options that the process supplies before every setting. A
	// canonical setting overrides a base option of the same name.
	Base []runtime.Option

	// Extra holds options that one command supplies last. The serve command
	// supplies its listen address here, so two replicas on one host take
	// separate schedule phases.
	Extra []runtime.Option
}

Composition builds the connected runtime of one process. It joins the parsed canonical settings with the roles that the process injects: the catalog store, the provider acquirer, and an optional upstream source implementation.

The root package cannot construct the Starmap cascade source, because the cascade subscriber imports the root package. This composition step is therefore the one place that builds it from the canonical settings.

func (Composition) Open

func (c Composition) Open(ctx context.Context) (*runtime.Runtime, error)

Open composes the options and opens the connected runtime. The runtime serves the verified embedded catalog immediately and pulls its source in the background.

func (Composition) Options

func (c Composition) Options() ([]runtime.Option, error)

Options returns the runtime options in precedence order: the process base options first, then canonical runtime options and the host clock, then the injected roles. A later option replaces an earlier one, so a canonical setting always wins over a base default.

type Config

type Config = catalogconfig.Config

Config is the shared parsed catalog configuration.

func Load

func Load(lookup Lookup) (Config, error)

Load reads the canonical settings through the supplied reader.

type Lookup

type Lookup = catalogconfig.Lookup

Lookup is a caller-supplied setting reader.

func Chain

func Chain(lookups ...Lookup) Lookup

Chain returns the first supplied value, including an explicit empty value.

func FlagLookup

func FlagLookup(flags *pflag.FlagSet) Lookup

FlagLookup reads a canonical setting from a registered flag. It reports only a flag that the caller changed, so an untouched flag never replaces the environment value.

Jump to

Keyboard shortcuts

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