apply

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package apply keeps the overlay file equal to the settings and the bound hooks: rendered at start, after every settings change and every binding change, and every resync interval (a file someone replaced).

Index

Constants

This section is empty.

Variables

View Source
var ErrNotWritten = errors.New("the overlay has not been written yet")

ErrNotWritten: the overlay has not been written yet.

Functions

This section is empty.

Types

type Applier

type Applier struct {
	deps.Component
	// contains filtered or unexported fields
}

Applier owns the overlay file.

func New

func New(
	parent deps.Scope,
	path string,
	mode os.FileMode,
	settings config.Live[overlay.Settings],
	salt config.Live[config.Secret],
	f *flows.Flows,
	w overlay.Wiring,
) *Applier

New creates the applier; an empty path renders without writing.

func (*Applier) Kick

func (a *Applier) Kick()

Kick asks for a rendering now.

func (*Applier) Masked

func (a *Applier) Masked() ([]byte, error)

Masked is the overlay for the current settings with every secret (the pairwise salt, the callbacks key) masked.

func (*Applier) Ready

func (a *Applier) Ready(context.Context) error

Ready: in file mode the overlay was written once (Hydra needs it).

func (*Applier) Render

func (a *Applier) Render() ([]byte, error)

Render is the overlay for the current settings, validated.

func (*Applier) State

func (a *Applier) State() State

State is the last rendering.

func (*Applier) Validate

func (a *Applier) Validate(s overlay.Settings) error

Validate checks candidate settings as the applier would render them.

type State

type State struct {
	// Path of the file; empty: snippets mode (nothing written).
	Path string
	// Content is the last rendering (secrets in it).
	Content []byte
	// Hash of Content; WrittenAt when it reached the file.
	Hash      string
	WrittenAt time.Time
	// Err is why the last rendering was not written; the file keeps the
	// previous one.
	Err error
}

State is what the applier last did.

Jump to

Keyboard shortcuts

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