program

package
v0.85.260915 Latest Latest
Warning

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

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

Documentation

Overview

Package program compiles globally ordered directive module programs and executes their exchange and round-trip lifetimes. An Executable is immutable: Compile runs once for a resolved Payload, while each recovery round trip only opens fresh round-trip instances from the existing bindings.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRuntimeClosed = errors.New("program runtime is closed")
	ErrRunClosed     = errors.New("program run is closed")
)

Functions

This section is empty.

Types

type Compiler

type Compiler interface {
	Compile(module.Specs) (*Executable, error)
}

type Executable

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

type HealthProvider

type HealthProvider interface {
	ModuleHealth() HealthSnapshot
}

type HealthSnapshot

type HealthSnapshot struct {
	Status  string                  `json:"status"`
	Modules map[string]HealthStatus `json:"modules"`
}

type HealthStatus

type HealthStatus struct {
	Status        string    `json:"status"`
	LastFailureAt time.Time `json:"last_failure_at,omitempty"`
}

type Run

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

func (*Run) Close

func (run *Run) Close()

func (*Run) OpenExchange

func (run *Run) OpenExchange(ctx module.OpenContext) (*Scope, error)

func (*Run) OpenRoundTrip

func (run *Run) OpenRoundTrip(ctx module.OpenContext) (*Scope, error)

type Runtime

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

func NewRuntime

func NewRuntime(catalog *module.Catalog, emission event.Provider) (*Runtime, error)

func (*Runtime) Close

func (runtime *Runtime) Close()

func (*Runtime) Compile

func (runtime *Runtime) Compile(source module.Specs) (*Executable, error)

func (*Runtime) ModuleHealth

func (runtime *Runtime) ModuleHealth() HealthSnapshot

func (*Runtime) StartRun

func (runtime *Runtime) StartRun(traceID string, executable *Executable, fields metadata.Set) (*Run, error)

type Scope

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

func (*Scope) Finish

func (s *Scope) Finish(ctx context.Context, cause module.FinishCause) error

type ScopeSet

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

ScopeSet is the globally ordered view of all currently active module scopes. It keeps directive program order across exchange- and round-trip-scoped modules.

func NewScopeSet

func NewScopeSet(scopes ...*Scope) *ScopeSet

func (*ScopeSet) DirectivePrepared

func (s *ScopeSet) DirectivePrepared(ctx context.Context, value lifecycle.DirectivePrepared) error

func (*ScopeSet) DownstreamBodyChunk

func (s *ScopeSet) DownstreamBodyChunk(ctx context.Context, value lifecycle.BodyChunk) error

func (*ScopeSet) DownstreamBodyEnded

func (s *ScopeSet) DownstreamBodyEnded(ctx context.Context, value lifecycle.BodyEnded) error

func (*ScopeSet) DownstreamResponseStarted

func (s *ScopeSet) DownstreamResponseStarted(ctx context.Context, value lifecycle.ResponseStarted) error

func (*ScopeSet) DownstreamSSEComment

func (s *ScopeSet) DownstreamSSEComment(ctx context.Context, value lifecycle.SSEComment) error

func (*ScopeSet) DownstreamSSEData

func (s *ScopeSet) DownstreamSSEData(ctx context.Context, value lifecycle.SSEData) error

func (*ScopeSet) Finish

func (s *ScopeSet) Finish(ctx context.Context, cause module.FinishCause) error

func (*ScopeSet) HasOutboundBodyMutators

func (s *ScopeSet) HasOutboundBodyMutators() bool

func (*ScopeSet) HasUpstreamBodyMutators

func (s *ScopeSet) HasUpstreamBodyMutators() bool

func (*ScopeSet) MutateOutboundBodyChunk

func (s *ScopeSet) MutateOutboundBodyChunk(ctx context.Context, draft *lifecycle.BodyDraft) error

func (*ScopeSet) MutateOutboundRequest

func (s *ScopeSet) MutateOutboundRequest(ctx context.Context, request *http.Request) error

func (*ScopeSet) MutateUpstreamBodyChunk

func (s *ScopeSet) MutateUpstreamBodyChunk(ctx context.Context, draft *lifecycle.BodyDraft) error

func (*ScopeSet) MutateUpstreamResponse

func (s *ScopeSet) MutateUpstreamResponse(ctx context.Context, draft *lifecycle.ResponseDraft) error

func (*ScopeSet) RecoveryDecided

func (s *ScopeSet) RecoveryDecided(ctx context.Context, value lifecycle.RecoveryDecided) error

func (*ScopeSet) RecoveryFinished

func (s *ScopeSet) RecoveryFinished(ctx context.Context, value lifecycle.RecoveryFinished) error

func (*ScopeSet) RecoveryStarted

func (s *ScopeSet) RecoveryStarted(ctx context.Context, value lifecycle.RecoveryStarted) error

func (*ScopeSet) RequestBodyChunk

func (s *ScopeSet) RequestBodyChunk(ctx context.Context, value lifecycle.BodyChunk) error

func (*ScopeSet) RequestBodyEnded

func (s *ScopeSet) RequestBodyEnded(ctx context.Context, value lifecycle.RequestBodyEnded) error

func (*ScopeSet) RequestFinished

func (s *ScopeSet) RequestFinished(ctx context.Context, value lifecycle.RequestFinished) error

func (*ScopeSet) RequestStarted

func (s *ScopeSet) RequestStarted(ctx context.Context, value lifecycle.RequestStarted) error

func (*ScopeSet) RoundTripFinished

func (s *ScopeSet) RoundTripFinished(ctx context.Context, value lifecycle.RoundTripFinished) error

func (*ScopeSet) RoundTripStarted

func (s *ScopeSet) RoundTripStarted(ctx context.Context, value lifecycle.RoundTripStarted) error

func (*ScopeSet) SetRoundTrip

func (s *ScopeSet) SetRoundTrip(roundTrip int)

func (*ScopeSet) UpstreamBodyChunk

func (s *ScopeSet) UpstreamBodyChunk(ctx context.Context, value lifecycle.BodyChunk) error

func (*ScopeSet) UpstreamBodyEnded

func (s *ScopeSet) UpstreamBodyEnded(ctx context.Context, value lifecycle.BodyEnded) error

func (*ScopeSet) UpstreamResponseStarted

func (s *ScopeSet) UpstreamResponseStarted(ctx context.Context, value lifecycle.ResponseStarted) error

func (*ScopeSet) UpstreamStarted

func (s *ScopeSet) UpstreamStarted(ctx context.Context, value lifecycle.UpstreamStarted) error

type StreamObserver

type StreamObserver interface {
	Observe(context.Context, time.Time, []byte) error
	Finish(context.Context, time.Time) error
}

func NewDownstreamObserver

func NewDownstreamObserver(contentType string, maxSSEEventBytes int, scopes *ScopeSet) StreamObserver

Jump to

Keyboard shortcuts

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