logpath

package
v2.19.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ForeachLogDirName is the directory, next to a foreach step's own log
	// files, that holds the log files of its item bodies.
	ForeachLogDirName = "foreach"

	// ForeachItemsFile lists the expanded items of a foreach step. It lives
	// in the step's foreach directory.
	ForeachItemsFile = "items.json"

	// ForeachItemStatusFile records an item's body run. It lives in the
	// item's directory.
	ForeachItemStatusFile = "status.json"
)

Variables

This section is empty.

Functions

func ForeachItemDir

func ForeachItemDir(stepDir, itemPath string) (string, error)

ForeachItemDir resolves an item path to its directory under stepDir. A path is "<index>" for a top-level item and "<index>.<bodyStep>.<index>" for an item of a nested foreach, where <bodyStep> is the safe name of the body step. Every segment is validated so the result stays inside stepDir.

func ForeachItemPath

func ForeachItemPath(parent string, index int) string

ForeachItemPath builds the item path of an item nested under parent. An empty parent addresses a top-level item.

func ForeachNestedParent

func ForeachNestedParent(itemPath, bodyStepName string) string

ForeachNestedParent builds the parent path for the items of a foreach body step running inside item itemPath.

func ForeachParentDir

func ForeachParentDir(stepDir, parent string) (string, error)

ForeachParentDir resolves a parent path to the foreach directory of the nested step it names. An empty parent resolves to stepDir itself.

func ForeachStepDir

func ForeachStepDir(stepLogFile, stepName string) string

ForeachStepDir returns the directory holding the item bodies of a foreach step whose own log file is stepLogFile.

func Generate

func Generate(ctx context.Context, baseLogDir, dagLogDir, dagName, dagRunID string) (string, error)

Generate expands the configured log directories, creates the DAG-run log directory if needed, and returns the full log file path.

Types

type Config

type Config struct {
	BaseDir   string
	DAGLogDir string
	Name      string
	DAGRunID  string
}

Config defines configuration for DAG run log file creation.

func (Config) LogDir

func (cfg Config) LogDir() (string, error)

LogDir is kept for backward compatibility with log-specific call sites.

func (Config) LogFile

func (cfg Config) LogFile() string

LogFile constructs the scheduler log filename using the current timestamp and a truncated DAG-run ID.

func (Config) RunDir

func (cfg Config) RunDir() (string, error)

RunDir creates and returns the per-run directory based on the configuration.

func (Config) Validate

func (cfg Config) Validate() error

Validate checks that essential fields are provided.

Jump to

Keyboard shortcuts

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