docs

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 24 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package docs generates documents from YAML metadata and native Terraform objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteGenerate

func ExecuteGenerate(cmd *cobra.Command, args []string) error

ExecuteGenerate implements 'atmos docs generate <doc-type>': it loads atmos.yaml honoring the global --base-path, --config, --config-path, and --profile flags, selects the docs.generate.<doc-type> entry, and generates the document with lifecycle hooks.

func Generate

func Generate(atmosConfig *schema.AtmosConfiguration, baseDir string, docsGenerate *schema.DocsGenerate) error

Generate merges YAML inputs, loads Terraform metadata, and renders the configured document.

func GenerateWithHooks

func GenerateWithHooks(atmosConfig *schema.AtmosConfiguration, cmd *cobra.Command, docType string, docsGenerate *schema.DocsGenerate) error

GenerateWithHooks generates the document configured under docs.generate.<docType> and runs the before.docs.generate and after.docs.generate lifecycle hooks around it. A before hook failure (or a policy denial) aborts before any file is written. After hooks run on success and on failure, filtered by each hook's `when`.

func RegisterHookRunnerFactory

func RegisterHookRunnerFactory(factory HookRunnerFactory)

RegisterHookRunnerFactory installs the factory that supplies lifecycle hooks to Generate callers. The pkg/hooks package registers it at init; a nil factory disables hooks.

Types

type HookRunner

type HookRunner interface {
	// Run fires event. genErr is the generation result for after events and nil for before
	// events. The returned error already reflects each hook's on_failure handling and any
	// policy denial.
	Run(event events.HookEvent, genErr error) error
}

HookRunner fires lifecycle hooks around document generation.

type HookRunnerFactory

type HookRunnerFactory func(req *HookRunnerRequest) (HookRunner, error)

HookRunnerFactory builds a HookRunner for one generation.

type HookRunnerRequest

type HookRunnerRequest struct {
	// AtmosConfig is the active configuration.
	AtmosConfig *schema.AtmosConfiguration
	// DocType is the docs.generate.<doc-type> key.
	DocType string
	// BaseDir is the absolute docs.generate.<doc-type>.base-dir.
	BaseDir string
	// OutputPath is the absolute path of the document being generated.
	OutputPath string
	// Hooks is the untyped docs.generate.<doc-type>.hooks map.
	Hooks map[string]any
	// Cmd is the running command, used for --skip-hooks.
	Cmd *cobra.Command
}

HookRunnerRequest describes the docs generation a HookRunner serves.

Jump to

Keyboard shortcuts

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