module

package
v1.75.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package module is the contract of a role of the service: the one thing `sluis <module>` starts (docs/decisions/0071). A module is assembled from one configuration file, runs until its context ends, and may tick once for a target. The roles are issuer (which hosts the signer and the console in its process), github, slack, cloudflare, google and backup; each has its own subpackage once it has a process of its own, and Unsplit stands in until then.

This package imports no role: a role's package imports it, and the import-boundary test (internal/boundaries) holds the roles apart.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotSplit is the answer of a module with no process of its own yet.
	ErrNotSplit = errors.New("not yet split")
	// ErrNoTick is the answer of a module that has no tick.
	ErrNoTick = errors.New("has no tick")
)

Functions

func CloseEmitter

func CloseEmitter(log *slog.Logger, c interface{ Close() error })

CloseEmitter closes a controller's audit emitter and says so when what its queue held is dropped.

func Logger

func Logger(ctx context.Context, w interface{ Write([]byte) (int, error) }, service string, level slog.Level) (*slog.Logger, func(), error)

Logger builds the process's JSON logger at the level its file chose, and starts telemetry under service. The returned function flushes the last pass's metrics, bounded: never a hung stop.

service is the name each of the three binaries reported before they were one (access-issuer, github-roster, slack-roster), so a dashboard or an alert that selects on it still finds the process.

Types

type Module

type Module interface {
	// Name is the subcommand: issuer, github, ...
	Name() string
	// Run assembles the module from file and serves until ctx ends.
	Run(ctx context.Context, file string) error
	// Tick assembles the module from file, does one unit of work for target
	// once, and returns. unsafeLocal opts in to ticking while the lease State
	// is this process's own memory. A module with no ticks returns [ErrNoTick].
	Tick(ctx context.Context, file, target string, unsafeLocal bool) error
}

Module is one role of the service.

type Unsplit

type Unsplit string

Unsplit is a module whose role still runs inside the issuer process.

func (Unsplit) Name

func (u Unsplit) Name() string

Name implements Module.

func (Unsplit) Run

Run implements Module.

func (Unsplit) Tick

Tick implements Module.

Directories

Path Synopsis
Package backup is the backup role: a scheduled export of the installation into an encrypted archive (docs/decisions/0071, decision 9), as a process of its own.
Package backup is the backup role: a scheduled export of the installation into an encrypted archive (docs/decisions/0071, decision 9), as a process of its own.
Package cloudflare is the Cloudflare role: the STS minter's scheduled rotation (docs/decisions/0070), as a process of its own.
Package cloudflare is the Cloudflare role: the STS minter's scheduled rotation (docs/decisions/0070), as a process of its own.
Package github is the GitHub role: the GitHub controller's loop, as a process of its own.
Package github is the GitHub role: the GitHub controller's loop, as a process of its own.
Package issuer is the issuer module (docs/decisions/0072): the issuer, the signer (internal/signer, in this process; no separate signer binary exists) and the console in one process.
Package issuer is the issuer module (docs/decisions/0072): the issuer, the signer (internal/signer, in this process; no separate signer binary exists) and the console in one process.
Package slack is the Slack role: the Slack controller's loop, as a process of its own.
Package slack is the Slack role: the Slack controller's loop, as a process of its own.

Jump to

Keyboard shortcuts

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