analysis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalysisFromStore

func AnalysisFromStore(op *store.Operation) *analysispb.Analysis

toAnalysis converts a store.Operation to its proto representation. The resource name is always the analysis form: "analyses/{uuid}".

func OperationFromStore

func OperationFromStore(op *store.Operation) *longrunningpb.Operation

toOperation wraps a store.Operation in an AIP-151 LRO. The operation name is always the LRO form: "operations/{uuid}". done=true when the operation has reached a terminal state.

func ToProtoState

func ToProtoState(s store.State) analysispb.Analysis_State

toProtoState maps a store.State to its analysispb.Analysis_State counterpart.

Types

type Analyzer

func (*Analyzer) CreateAnalysis

CreateAnalysis implements the AIP-133 Create + AIP-151 LRO pattern.

Flow:

  1. Validate the request.
  2. Check the input-hash cache — return existing SUCCEEDED operation if hit.
  3. Resolve the operation name (client-provided or server-assigned).
  4. If the operation name already exists, return the existing operation.
  5. Insert the row as RUNNING and fire the executor goroutine.
  6. Return the LRO immediately (done=false if still running).

func (*Analyzer) GetAnalysis

func (a *Analyzer) GetAnalysis(
	ctx context.Context,
	req *analysispb.GetAnalysisRequest,
) (*analysispb.Analysis, error)

GetAnalysis implements AIP-131.

The resource name may be provided in either its analysis form ("analyses/{uuid}") or its operation form ("operations/{uuid}") — both map to the same row. The returned Analysis carries the analysis resource name.

func (*Analyzer) ListAnalyses

ListAnalyses implements AIP-132 with keyset cursor pagination.

Results are ordered by (create_time DESC, operation_name), which:

  • Returns the newest analyses first, matching typical operator usage.
  • Provides a stable cursor: new rows inserted between pages only appear on page 1, never shift existing pages, enabling downstream services to use the first-page delta for drift detection.

Page size defaults to 50 and is capped at 1000. Pass NextPageToken from the previous response to advance to the next page.

Jump to

Keyboard shortcuts

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