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

configops

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package configops owns the configuration field operations of one gateway process: the schema, the effective report, validation, a source connection test, field saves, and operation receipts. A local deployment saves to its configuration file. A shared deployment saves to the shared revision store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Store is the shared revision store. Shared management requires it.
	Store *configrevision.Store
	// LocalAudit records a local save.
	LocalAudit config.LocalAudit
	// Observe records the newest stored head after a shared save. The
	// receipt then reports the desired revision of this process.
	Observe func(context.Context) error
	// Probe tests the catalog source. A nil probe refuses the test.
	Probe Probe
}

Options supplies the adapters of a Service.

type Probe

type Probe func(ctx context.Context, catalog config.CatalogConfig) error

Probe checks that the catalog source of the settings answers. Its error must not hold a credential.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service runs configuration operations against the authority that the management mode selects. Schema and Effective read process memory only.

func New

func New(cfg *config.Config, options Options) (*Service, error)

New returns the configuration operations of cfg.

func (*Service) Effective

func (s *Service) Effective() config.EffectiveReport

Effective returns the redacted effective configuration from memory.

func (*Service) Receipt

func (s *Service) Receipt(ctx context.Context, operationID string) (config.Receipt, bool, error)

Receipt returns the receipt of an operation ID. It reports false when the operation ID saved nothing.

func (*Service) Save

func (s *Service) Save(ctx context.Context, request config.FieldSave, actor string) (config.Receipt, error)

Save writes a field save. A local save publishes the configuration file. A shared save commits the next revision when the head is at the expected sequence. An exact retry returns the original receipt. A refusal is a *config.Refusal error.

func (*Service) Schema

func (s *Service) Schema() []config.SchemaSetting

Schema returns the configuration setting descriptors.

func (*Service) TestConnection

func (s *Service) TestConnection(ctx context.Context, request config.FieldSave) (config.ConnectionResult, error)

TestConnection probes the catalog source of the effective settings, or of the settings with the request edits applied. It writes nothing, and the result never holds a credential or a source URL.

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, request config.FieldSave) (config.Validation, error)

Validate checks a field save and previews the revision that it would write. It writes nothing. An edit refusal is in the result.

Jump to

Keyboard shortcuts

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