batch

package
v0.0.0-...-c015bd6 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package batch provides CLI commands for batch job operations.

Purpose: - Talk to the local REST API for batch list, submit, status, and cancel flows.

Responsibilities: - Marshal batch requests for HTTP submission. - Fetch batch list pages and individual batch envelopes. - Cancel persisted batches through the API.

Scope: - HTTP transport only; direct-mode execution and CLI parsing live elsewhere.

Usage: - Called by batch CLI subcommands when the local API server is available.

Invariants/Assumptions: - API responses use the stable shared batch envelopes. - Non-2xx HTTP responses are surfaced as user-facing errors.

Package batch provides CLI commands for batch job operations.

Purpose: - Route operator-facing batch list, submit, status, and cancel subcommands.

Responsibilities: - Dispatch batch CLI subcommands and render top-level help text. - Keep the batch command surface discoverable from one entrypoint.

Scope: - Command routing only; individual subcommand implementations live in sibling files.

Usage: - Invoked from `spartan batch ...`.

Invariants/Assumptions: - Unknown subcommands print help and exit non-zero. - Batch subcommands prefer the local API when available and fall back to direct mode where supported.

Package batch provides CLI commands for batch job operations.

Purpose: - Execute batch submissions directly when the API server is not running.

Responsibilities: - Convert canonical batch requests into job specs for direct execution. - Create, enqueue, inspect, and cancel batches through local manager/store access. - Reuse the shared batch request-to-spec conversion from internal/submission.

Scope: - Direct CLI batch execution only.

Usage: - Called by CLI batch submit/status/cancel flows when local direct mode is selected.

Invariants/Assumptions: - Direct execution should persist the same specs as equivalent API batch submissions. - Auth is already resolved by CLI flag handling before direct batch conversion runs.

Package batch provides CLI commands for batch job operations.

Purpose: - Expose paginated batch summary inspection for terminal operators.

Responsibilities: - Parse `spartan batch list` flags. - Prefer the local API when available, with direct-store fallback offline. - Render aggregate batch summaries with pagination metadata.

Scope: - Batch listing only; batch submission, detail, and cancel flows live elsewhere.

Usage: - Run `spartan batch list [--limit N] [--offset N]`.

Invariants/Assumptions: - Limit defaults to 100 and is capped at 1000. - Offset must be greater than or equal to 0. - Batch rows show aggregate stats only; use `spartan batch status <id>` for jobs.

Package batch provides CLI commands for batch job operations.

This file contains parsing logic for batch job inputs.

Responsibilities: - Parse batch jobs from CSV/JSON files - Parse batch jobs from URL lists - Detect file formats automatically

Does NOT handle: - API submission - Direct execution - Status checking

Package batch provides CLI commands for batch job operations.

Purpose: - Expose batch detail, progress watching, and cancellation for terminal operators.

Responsibilities: - Parse `spartan batch status` and `spartan batch cancel` arguments. - Display canonical batch progress, aggregate stats, and optional enriched job rows. - Poll batch status until completion when watch/wait flows are requested.

Scope: - Batch detail/status presentation only; submission and transport helpers live in sibling files.

Usage: - Run `spartan batch status <batch-id> [--watch] [--include-jobs]` or `spartan batch cancel <batch-id>`.

Invariants/Assumptions: - Batch responses already include explicit progress summaries. - Included jobs use the same inspectable run contract as the API and MCP surfaces. - Terminal batch statuses are completed, failed, partial, and canceled.

Package batch provides CLI commands for batch job operations.

Purpose: - Parse and run CLI batch submission commands for scrape, crawl, and research jobs.

Responsibilities: - Register batch submit flags and build canonical batch requests from CLI input. - Run shared preflight validation through internal/submission before transport selection. - Dispatch validated requests through the API or direct execution paths.

Scope: - Batch submit command handling only.

Usage: - Invoked by `spartan batch submit <kind> ...`.

Invariants/Assumptions: - CLI batch preflight errors should match canonical submission-layer validation. - File parsing, API transport, and direct execution are delegated to sibling files.

Package batch provides CLI commands for batch job operations.

Purpose: - Reuse the canonical operator-facing batch request and response contracts in the CLI.

Responsibilities: - Alias the shared batch request payloads used by API and direct CLI execution. - Alias the stable batch response envelopes returned across transports. - Keep CLI batch request shapes aligned with the shared submission contract.

Scope: - Batch CLI request and response contract aliases only.

Usage: - Imported by CLI batch parsing, submission, direct execution, and tests.

Invariants/Assumptions: - CLI batch requests should stay wire-compatible with the REST batch API. - Batch request-to-spec conversion lives outside this file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBatch

func RunBatch(ctx context.Context, cfg config.Config, args []string) int

RunBatch executes the batch command with the given arguments.

Types

type BatchCrawlRequest

type BatchCrawlRequest = submission.BatchCrawlRequest

BatchCrawlRequest represents a batch crawl request.

type BatchJobRequest

type BatchJobRequest = submission.BatchJobRequest

BatchJobRequest represents a single job in a batch.

type BatchListResponse

type BatchListResponse = spartanapi.BatchListResponse

BatchListResponse aliases the stable paginated batch-summary collection envelope.

type BatchResearchRequest

type BatchResearchRequest = submission.BatchResearchRequest

BatchResearchRequest represents a batch research request.

type BatchResponse

type BatchResponse = spartanapi.BatchResponse

BatchResponse represents the stable batch envelope used by API and direct CLI flows.

type BatchScrapeRequest

type BatchScrapeRequest = submission.BatchScrapeRequest

BatchScrapeRequest represents a batch scrape request.

type BatchStatusResponse

type BatchStatusResponse = spartanapi.BatchResponse

BatchStatusResponse aliases the same stable batch envelope for legacy CLI call sites.

type BatchSummary

type BatchSummary = spartanapi.BatchSummary

BatchSummary aliases the stable aggregate batch metadata used across surfaces.

Jump to

Keyboard shortcuts

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