logs

package
v1.0.39078-pre Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package logs implements the business logic for fetching CircleCI job logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LastFailed

func LastFailed(ctx context.Context, client *apiclient.Client, runID string) (jobNumber int64, projectSlug string, err error)

LastFailed finds the latest failed job across all workflows in a run. If all workflows passed, it returns ErrNoneFound with a clear message so callers can surface a clean error rather than "no failed jobs found" after a full traversal.

func LastJob

func LastJob(ctx context.Context, client *apiclient.Client, runID string) (jobNumber int64, projectSlug string, err error)

LastJob finds the most recently completed job across all workflows in a run.

Types

type ErrNoneFound

type ErrNoneFound struct {
	Reason string
}

ErrNoneFound is returned when an inference strategy finds no matching job.

func (*ErrNoneFound) Error

func (e *ErrNoneFound) Error() string

type StepLog

type StepLog struct {
	Name     string `json:"step"`
	Status   string `json:"status"`
	ExitCode *int   `json:"exit_code,omitempty"`
	Output   string `json:"output"`
}

StepLog holds the output of a single job step.

func ForJob

func ForJob(ctx context.Context, client *apiclient.Client, projectSlug string, jobNumber int64, stepFilter string) ([]StepLog, error)

ForJob fetches the log output for every step in a job, returning one StepLog per step. If stepFilter is non-empty, only steps whose name matches are included. Steps are fetched concurrently (up to maxStepParallelism at a time); output order matches the original step order.

Jump to

Keyboard shortcuts

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