execution

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 41 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxResponseBytes = 5 << 20

Variables

This section is empty.

Functions

func ActiveState added in v1.0.3

func ActiveState(state string) bool

func EncodeLogCursor added in v1.0.3

func EncodeLogCursor(s LogSummary) string

func MaskBlock

func MaskBlock(block catalog.Block, redactor *resources.Redactor) catalog.Block

func MaskResult

func MaskResult(result *Result, redactor *resources.Redactor)

func PageLogs added in v1.0.3

func PageLogs(items []LogSummary, f LogFilter) (catalog.Page[LogSummary], error)

func ResearchComparison

func ResearchComparison() comparison.Result

func ValidLogID added in v1.0.3

func ValidLogID(id string) bool

func WithRequestGate

func WithRequestGate(ctx context.Context, gate func(context.Context) error) context.Context

func WithSourceTrace added in v1.0.3

func WithSourceTrace(ctx context.Context, s *SourceTrace) context.Context

func WithTraceRecorder added in v1.0.3

func WithTraceRecorder(ctx context.Context, r TraceRecorder) context.Context

Types

type Attempt

type Attempt struct {
	VariantID          string              `json:"variantId,omitempty"`
	VariantVersionID   string              `json:"variantVersionId,omitempty"`
	BatchID            string              `json:"batchId,omitempty"`
	BatchPosition      int                 `json:"batchPosition,omitempty"`
	ID                 string              `json:"id"`
	RunID              string              `json:"runId,omitempty"`
	TestCaseID         string              `json:"testCaseId"`
	BlockID            string              `json:"blockId"`
	Revision           int64               `json:"revision"`
	EnvironmentID      string              `json:"environmentId"`
	EnvironmentName    string              `json:"environmentName"`
	Resource           resources.Resource  `json:"resource"`
	Request            catalog.CallRequest `json:"request"`
	Number             int                 `json:"number"`
	State              string              `json:"state"`
	StartedAt          time.Time           `json:"startedAt"`
	FinishedAt         *time.Time          `json:"finishedAt,omitempty"`
	DurationMS         int64               `json:"durationMs"`
	PersistencePending bool                `json:"persistencePending"`
	Result             *Result             `json:"result,omitempty"`
}

type CallLog added in v1.0.3

type CallLog struct {
	Summary           LogSummary `json:"summary"`
	Request           LogRequest `json:"request"`
	Response          *Result    `json:"response,omitempty"`
	BodyOmittedReason string     `json:"bodyOmittedReason,omitempty"`
	IncompleteReason  string     `json:"incompleteReason,omitempty"`
}

func LegacyLog added in v1.0.3

func LegacyLog(a Attempt) CallLog

type HTTPVariableProbe added in v1.0.3

type HTTPVariableProbe struct {
	ID                 string                   `json:"id"`
	Scope              string                   `json:"scope"`
	EnvironmentID      string                   `json:"environmentId"`
	ResourceID         string                   `json:"resourceId,omitempty"`
	VariableName       string                   `json:"variableName,omitempty"`
	Source             catalog.HTTPHeaderSource `json:"source"`
	LogID              string                   `json:"logId,omitempty"`
	State              string                   `json:"state"`
	StartedAt          time.Time                `json:"startedAt"`
	FinishedAt         *time.Time               `json:"finishedAt,omitempty"`
	DurationMS         int64                    `json:"durationMs"`
	StatusCode         *int                     `json:"statusCode,omitempty"`
	ErrorCode          string                   `json:"errorCode,omitempty"`
	Error              string                   `json:"error,omitempty"`
	PersistencePending bool                     `json:"persistencePending"`
}

HTTPVariableProbe contains only safe, durable diagnostics, never a fetched value.

type HeaderSourceResult

type HeaderSourceResult struct {
	LogID      string `json:"logId,omitempty"`
	HeaderID   string `json:"headerId"`
	HeaderName string `json:"headerName"`
	FetchMode  string `json:"fetchMode"`
	State      string `json:"state"`
	StatusCode *int   `json:"statusCode,omitempty"`
	DurationMS int64  `json:"durationMs"`
	ErrorCode  string `json:"errorCode,omitempty"`
}

type LogCursor added in v1.0.3

type LogCursor struct {
	StartedAt time.Time `json:"at"`
	ID        string    `json:"id"`
}

type LogFilter added in v1.0.3

type LogFilter struct {
	From          string `json:"from,omitempty"`
	To            string `json:"to,omitempty"`
	Protocol      string `json:"protocol,omitempty"`
	Origin        string `json:"origin,omitempty"`
	Stage         string `json:"stage,omitempty"`
	State         string `json:"state,omitempty"`
	EnvironmentID string `json:"environmentId,omitempty"`
	ResourceID    string `json:"resourceId,omitempty"`
	TestCaseID    string `json:"testCaseId,omitempty"`
	RunID         string `json:"runId,omitempty"`
	AttemptID     string `json:"attemptId,omitempty"`
	ProbeID       string `json:"probeId,omitempty"`
	Limit         int    `json:"limit,omitempty"`
	Cursor        string `json:"cursor,omitempty"`
}

func (LogFilter) Matches added in v1.0.3

func (f LogFilter) Matches(s LogSummary) bool

func (LogFilter) Validate added in v1.0.3

func (f LogFilter) Validate() (LogCursor, error)

type LogRequest added in v1.0.3

type LogRequest struct {
	Protocol   string               `json:"protocol"`
	Address    string               `json:"address,omitempty"`
	Method     string               `json:"method,omitempty"`
	URL        string               `json:"url,omitempty"`
	Headers    []catalog.KeyValue   `json:"headers"`
	Body       string               `json:"body"`
	SQL        string               `json:"sql,omitempty"`
	Parameters []catalog.TypedValue `json:"parameters,omitempty"`
	Mode       string               `json:"mode,omitempty"`
	Truncated  bool                 `json:"truncated"`
}

LogRequest is an application-level request, captured after substitution. It deliberately has no transport credentials or TLS private key fields.

type LogSummary added in v1.0.3

type LogSummary struct {
	ID                   string     `json:"id"`
	AttemptID            string     `json:"attemptId,omitempty"`
	ProbeID              string     `json:"probeId,omitempty"`
	RunID                string     `json:"runId,omitempty"`
	TestCaseID           string     `json:"testCaseId,omitempty"`
	BlockID              string     `json:"blockId,omitempty"`
	VariantID            string     `json:"variantId,omitempty"`
	EnvironmentID        string     `json:"environmentId"`
	EnvironmentName      string     `json:"environmentName"`
	EnvironmentVersionID string     `json:"environmentVersionId,omitempty"`
	ResourceID           string     `json:"resourceId,omitempty"`
	ResourceName         string     `json:"resourceName,omitempty"`
	ResourceVersionID    string     `json:"resourceVersionId,omitempty"`
	Protocol             string     `json:"protocol"`
	Origin               string     `json:"origin"`
	Stage                string     `json:"stage"`
	SourceName           string     `json:"sourceName,omitempty"`
	Position             int        `json:"position"`
	State                string     `json:"state"`
	StartedAt            time.Time  `json:"startedAt"`
	FinishedAt           *time.Time `json:"finishedAt,omitempty"`
	DurationMS           int64      `json:"durationMs"`
	RequestSent          bool       `json:"requestSent"`
	Legacy               bool       `json:"legacy"`
	Redacted             bool       `json:"redacted"`
	PersistencePending   bool       `json:"persistencePending"`
}

func LegacySummary added in v1.0.3

func LegacySummary(a Attempt) LogSummary

type ProbeInput added in v1.0.3

type ProbeInput struct {
	Scope               string                                  `json:"scope"`
	EnvironmentID       string                                  `json:"environmentId"`
	EnvironmentRevision int64                                   `json:"environmentRevision"`
	ResourceID          string                                  `json:"resourceId,omitempty"`
	ResourceRevision    int64                                   `json:"resourceRevision,omitempty"`
	VariableName        string                                  `json:"variableName,omitempty"`
	Source              *catalog.HTTPHeaderSource               `json:"source,omitempty"`
	Variables           map[string]string                       `json:"variables,omitempty"`
	ResourceVariables   map[string]resources.VariableDefinition `json:"resourceVariables,omitempty"`
	Secrets             *resources.SecretChanges                `json:"secrets,omitempty"`
	TimeoutSeconds      int                                     `json:"timeoutSeconds,omitempty"`
	IdempotencyKey      string                                  `json:"idempotencyKey"`
}

ProbeInput is never persisted: its draft may contain write-only secret changes.

type ProbeView added in v1.0.3

type ProbeView struct {
	Probe            HTTPVariableProbe `json:"probe"`
	ValueAvailable   bool              `json:"valueAvailable"`
	ValueUnavailable string            `json:"valueUnavailable,omitempty"`
	ExtractedValue   *string           `json:"extractedValue,omitempty"`
	FormattedValue   *string           `json:"formattedValue,omitempty"`
	ValueType        string            `json:"valueType,omitempty"`
}

ProbeView is the sole live value projection. Repositories only accept Probe.

type Result

type Result struct {
	VariableSources    []VariableSourceResult `json:"variableSources,omitempty"`
	HeaderSources      []HeaderSourceResult   `json:"headerSources,omitempty"`
	MainRequestStarted *bool                  `json:"mainRequestStarted,omitempty"`
	Protocol           string                 `json:"protocol"`
	StatusCode         *int                   `json:"statusCode,omitempty"`
	GRPCCode           string                 `json:"grpcCode,omitempty"`
	StatusMessage      string                 `json:"statusMessage,omitempty"`
	Headers            []catalog.KeyValue     `json:"headers"`
	Trailers           []catalog.KeyValue     `json:"trailers,omitempty"`
	Body               string                 `json:"body"`
	Columns            []catalog.Column       `json:"columns,omitempty"`
	Rows               [][]catalog.TypedValue `json:"rows,omitempty"`
	RowsAffected       *string                `json:"rowsAffected,omitempty"`
	ErrorCode          string                 `json:"errorCode,omitempty"`
	Error              string                 `json:"error,omitempty"`
	Truncated          bool                   `json:"truncated"`
	Redacted           bool                   `json:"redacted"`
	Comparison         comparison.Result      `json:"comparison"`
}

type Runner

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

func NewRunner

func NewRunner() *Runner

func (*Runner) ClearHeaderScopes

func (r *Runner) ClearHeaderScopes()

func (*Runner) Execute

func (r *Runner) Execute(ctx context.Context, scope string, block catalog.Block, res resources.Resolved) (string, Result)

func (*Runner) ExecuteResearch

func (r *Runner) ExecuteResearch(ctx context.Context, scope string, block catalog.Block, res resources.Resolved) (string, Result)

func (*Runner) FetchVariableSource added in v1.0.3

func (r *Runner) FetchVariableSource(ctx context.Context, s catalog.HTTPHeaderSource, res resources.Resolved) (string, *int, error)

FetchVariableSource shares the exact source transport/extraction pipeline.

func (*Runner) ForgetScope

func (r *Runner) ForgetScope(id string)

type SourceTrace added in v1.0.3

type SourceTrace struct {
	Stage     string
	Name      string
	Source    *catalog.HTTPHeaderSource
	LogID     string
	ValueType string
}

type TraceRecorder added in v1.0.3

type TraceRecorder interface {
	BeginTrace(context.Context, *CallLog) error
	EndTrace(context.Context, CallLog) error
}

TraceRecorder receives only already-masked projections.

type VariableSourceResult added in v1.0.1

type VariableSourceResult struct {
	LogID      string `json:"logId,omitempty"`
	Scope      string `json:"scope,omitempty"`
	Name       string `json:"name"`
	FetchMode  string `json:"fetchMode"`
	State      string `json:"state"`
	StatusCode *int   `json:"statusCode,omitempty"`
	DurationMS int64  `json:"durationMs"`
	ErrorCode  string `json:"errorCode,omitempty"`
}

Jump to

Keyboard shortcuts

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