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

distribution

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package distribution supplies public value options for reusable binary entries. Edition, Assembly, Assembly.Clone, MetricsConfig and OTLPConfig are designated reusable entry values; release protection follows the enterprise extension contract. Assembly.Registry and Assembly.Manifest freeze linked registrations and metadata. Assembly.AttributionPolicy validates the assembly-owned attribute allowlist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotate

func Annotate(cmd *cobra.Command, a Assembly)

Annotate attaches a serialized snapshot to a command, without process globals. Annotations are diagnostic transport; serving uses the validated registry.

Types

type Assembly

type Assembly struct {
	Edition             Edition                       `json:"edition"`
	Modules             []extension.Descriptor        `json:"modules,omitempty"`
	Factories           map[string]*extension.Factory `json:"-"`
	AttributeKeys       []string                      `json:"-"`
	AttributionProducer attribution.Producer          `json:"-"`
	EventSinks          []event.Registration          `json:"-"`
}

Assembly records explicitly linked modules. Metadata does not link factories; main must import the implementations it declares. Factories are explicit executable registrations and never appear in serialized metadata.

func CommunityRuntime

func CommunityRuntime() Assembly

CommunityRuntime is the metadata shared by both Community server entries.

func CommunityValidation

func CommunityValidation() Assembly

CommunityValidation declares CLI factories; it does not claim server execution.

func (Assembly) AttributionPolicy

func (a Assembly) AttributionPolicy() (attribution.Policy, error)

AttributionPolicy validates the exact assembly-owned attribute allowlist.

func (Assembly) Clone

func (a Assembly) Clone() Assembly

Clone takes ownership of a metadata snapshot without retaining caller slices.

func (Assembly) Manifest

func (a Assembly) Manifest() (Assembly, error)

Manifest returns a canonical, pointer-free assembly for serialization.

func (Assembly) Registry

func (a Assembly) Registry() (*extension.Registry, error)

Registry freezes the explicitly linked metadata and configuration factories. Factory IDs must be declared in Modules; no implicit registration is allowed.

type Edition

type Edition struct {
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
}

Edition is distribution-owned identification, never an entitlement decision.

type MetricsConfig

type MetricsConfig struct {
	RetentionDays int        `json:"retention_days,omitempty"`
	MaxAgentDepth int        `json:"max_agent_depth,omitempty"`
	OTLP          OTLPConfig `json:"otlp,omitzero"`
}

MetricsConfig is the public metrics configuration value for entry options.

type OTLPConfig

type OTLPConfig struct {
	Endpoint       string            `json:"endpoint,omitempty"`
	Protocol       string            `json:"protocol,omitempty"`
	Insecure       bool              `json:"insecure,omitempty"`
	Headers        map[string]string `json:"headers,omitempty"`
	ServiceName    string            `json:"service_name,omitempty"`
	TimeoutSeconds int               `json:"timeout_seconds,omitempty"`
	Components     bool              `json:"components,omitempty"`
}

OTLPConfig configures the existing usage exporter. Empty Endpoint disables it.

Directories

Path Synopsis
Package caddycmd adapts the upstream Caddy process entry.
Package caddycmd adapts the upstream Caddy process entry.
Package contracttest exercises independently built distribution binaries.
Package contracttest exercises independently built distribution binaries.
Package ctlcmd constructs management CLI commands without import-time process side effects.
Package ctlcmd constructs management CLI commands without import-time process side effects.
Package daemoncmd constructs standalone daemon commands.
Package daemoncmd constructs standalone daemon commands.

Jump to

Keyboard shortcuts

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