app

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package app assembles the GitHub controller from its configuration: the policy's GitHub table, the console it reads with its own ServiceAccount token, the report it writes, and the credentials mounted beside it.

A package rather than the body of main, for the reason the service's equivalents are: this is where the decisions a deployment can get wrong are made, and main() cannot be tested.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is an assembled controller.

func New

func New(ctx context.Context, cfg Config, log *slog.Logger) (*App, error)

New assembles the controller.

func (*App) Close

func (a *App) Close() error

Close closes the audit emitter, which delivers what its queue holds within its timeout and drops the rest, saying so. Nothing survives the process.

func (*App) Run

func (a *App) Run(ctx context.Context) error

Run passes until the context is done, or the audit installation refuses the catalogue after the start, which ends the process the way a refusal at the start would have.

func (*App) Tick

func (a *App) Tick(ctx context.Context, target string, unsafeLocal bool) error

Tick runs one target's tick once, under its lease, and returns: an organisation's login, or controller.LinksTarget. It is what `sluis tick github` runs, and the shape of a function that lives for one invocation. A target another runner holds is left to it.

type Config

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

Config is what a deployment decides. It is built from the configuration file, which is what the chart renders.

func FromConfig

func FromConfig(f *config.ControllerGitHub) (Config, error)

FromConfig builds the settings from a configuration already read. What a schema cannot say is checked here, before anything starts.

func Load

func Load(file string) (Config, error)

Load reads the configuration file, holds it to its schema, and builds the settings from it.

func (Config) LogLevel

func (c Config) LogLevel() slog.Level

LogLevel is the level the process should log at.

Jump to

Keyboard shortcuts

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