client

package
v1.3.2 Latest Latest
Warning

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

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

Documentation

Overview

Package client provides clients for querying external services from the WFE controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OgenWorkflowQuerier

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

OgenWorkflowQuerier implements WorkflowQuerier using the ogen-generated DS client. DD-API-001 compliant: uses generated OpenAPI client for type safety.

func NewOgenWorkflowQuerier

func NewOgenWorkflowQuerier(client WorkflowCatalogClient) *OgenWorkflowQuerier

NewOgenWorkflowQuerier creates a WorkflowQuerier from an existing ogen client wrapper.

func NewOgenWorkflowQuerierFromConfig

func NewOgenWorkflowQuerierFromConfig(baseURL string, timeout time.Duration) (*OgenWorkflowQuerier, error)

NewOgenWorkflowQuerierFromConfig creates a WorkflowQuerier with a standalone ogen client configured from the DataStorage URL and timeout. Uses ServiceAccount auth transport (same pattern as DSHistoryAdapter).

func (*OgenWorkflowQuerier) GetWorkflowDependencies

func (q *OgenWorkflowQuerier) GetWorkflowDependencies(ctx context.Context, workflowID string) (*models.WorkflowDependencies, error)

GetWorkflowDependencies fetches the workflow from DS by ID and extracts schema-declared dependencies from the Content field (raw YAML). Returns nil if the workflow has no dependencies declared.

func (*OgenWorkflowQuerier) GetWorkflowEngineConfig added in v1.1.0

func (q *OgenWorkflowQuerier) GetWorkflowEngineConfig(ctx context.Context, workflowID string) (json.RawMessage, error)

GetWorkflowEngineConfig retrieves the engine_config from the DS catalog. DD-WORKFLOW-017: The WE controller resolves execution details from the catalog. Returns nil when the workflow has no engineConfig section.

func (*OgenWorkflowQuerier) GetWorkflowExecutionBundle added in v1.3.0

func (q *OgenWorkflowQuerier) GetWorkflowExecutionBundle(ctx context.Context, workflowID string) (string, string, error)

GetWorkflowExecutionBundle retrieves the execution bundle OCI reference and its digest from the DS catalog. Returns empty strings when the catalog entry does not define an execution bundle (caller preserves the existing spec value).

func (*OgenWorkflowQuerier) GetWorkflowExecutionEngine added in v1.2.0

func (q *OgenWorkflowQuerier) GetWorkflowExecutionEngine(ctx context.Context, workflowID string) (string, string, error)

GetWorkflowExecutionEngine retrieves the execution engine and workflow name from the DS catalog entry. Issue #518: the WE controller resolves the engine at runtime rather than reading it from the (now-removed) WFE spec field.

func (*OgenWorkflowQuerier) ResolveWorkflowCatalogMetadata added in v1.3.0

func (q *OgenWorkflowQuerier) ResolveWorkflowCatalogMetadata(ctx context.Context, workflowID string) (*WorkflowCatalogMetadata, error)

ResolveWorkflowCatalogMetadata fetches all workflow metadata from DS in one GetWorkflowByID call (Issue #650).

type WorkflowCatalogClient

type WorkflowCatalogClient interface {
	GetWorkflowByID(ctx context.Context, params ogenclient.GetWorkflowByIDParams) (ogenclient.GetWorkflowByIDRes, error)
}

WorkflowCatalogClient is a narrow interface satisfied by the ogen-generated *ogenclient.Client. Defined here for testability (mock injection).

type WorkflowCatalogMetadata added in v1.3.0

type WorkflowCatalogMetadata struct {
	ExecutionEngine       string
	WorkflowName          string
	ExecutionBundle       string
	ExecutionBundleDigest string
	ServiceAccountName    string
	EngineConfig          json.RawMessage
	Dependencies          *models.WorkflowDependencies
}

WorkflowCatalogMetadata holds all workflow metadata resolved from the DS catalog in a single GetWorkflowByID call (Issue #650). Consolidates what was previously 4 separate calls into one round-trip.

type WorkflowQuerier

type WorkflowQuerier interface {
	GetWorkflowDependencies(ctx context.Context, workflowID string) (*models.WorkflowDependencies, error)
	// GetWorkflowEngineConfig retrieves the engine_config for a workflow from the catalog.
	// DD-WORKFLOW-017: Execution details (engine, engineConfig) come from the workflow catalog entry.
	// Returns nil when the workflow has no engineConfig.
	GetWorkflowEngineConfig(ctx context.Context, workflowID string) (json.RawMessage, error)
	// GetWorkflowExecutionEngine retrieves the execution engine and workflow name
	// from the DS catalog. Issue #518: the WE controller resolves the engine at
	// runtime rather than reading it from the WFE spec.
	GetWorkflowExecutionEngine(ctx context.Context, workflowID string) (engine string, workflowName string, err error)
	// GetWorkflowExecutionBundle retrieves the execution bundle OCI reference and
	// its digest from the DS catalog. Defense-in-depth: the WE controller resolves
	// the bundle at runtime rather than blindly trusting the WFE spec value.
	GetWorkflowExecutionBundle(ctx context.Context, workflowID string) (bundle string, digest string, err error)
	// ResolveWorkflowCatalogMetadata fetches all workflow metadata (engine, bundle,
	// SA, engineConfig, dependencies) from DS in a single GetWorkflowByID call.
	// Issue #650: Replaces the 4 individual methods above.
	ResolveWorkflowCatalogMetadata(ctx context.Context, workflowID string) (*WorkflowCatalogMetadata, error)
}

WorkflowQuerier retrieves workflow metadata from the Data Storage catalog. DD-WE-006: WFE queries DS on demand using the workflow ID. Issue #650: Consolidated into a single method to avoid redundant DS calls.

Jump to

Keyboard shortcuts

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