pipeline

package
v6.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// Request encapsulates the provider facing request payload.
	Request cliproxyexecutor.Request
	// Options carries execution flags (streaming, headers, etc.).
	Options cliproxyexecutor.Options
	// Auth references the credential selected for execution.
	Auth *cliproxyauth.Auth
	// Translator represents the pipeline responsible for schema adaptation.
	Translator *sdktranslator.Pipeline
	// HTTPClient allows middleware to customise the outbound transport per request.
	HTTPClient *http.Client
}

Context encapsulates execution state shared across middleware, translators, and executors.

type Hook

type Hook interface {
	BeforeExecute(ctx context.Context, execCtx *Context)
	AfterExecute(ctx context.Context, execCtx *Context, resp cliproxyexecutor.Response, err error)
	OnStreamChunk(ctx context.Context, execCtx *Context, chunk cliproxyexecutor.StreamChunk)
}

Hook captures middleware callbacks around execution.

type HookFunc

type HookFunc struct {
	Before func(context.Context, *Context)
	After  func(context.Context, *Context, cliproxyexecutor.Response, error)
	Stream func(context.Context, *Context, cliproxyexecutor.StreamChunk)
}

HookFunc aggregates optional hook implementations.

func (HookFunc) AfterExecute

func (h HookFunc) AfterExecute(ctx context.Context, execCtx *Context, resp cliproxyexecutor.Response, err error)

AfterExecute implements Hook.

func (HookFunc) BeforeExecute

func (h HookFunc) BeforeExecute(ctx context.Context, execCtx *Context)

BeforeExecute implements Hook.

func (HookFunc) OnStreamChunk

func (h HookFunc) OnStreamChunk(ctx context.Context, execCtx *Context, chunk cliproxyexecutor.StreamChunk)

OnStreamChunk implements Hook.

type RoundTripperProvider

type RoundTripperProvider interface {
	RoundTripperFor(auth *cliproxyauth.Auth) http.RoundTripper
}

RoundTripperProvider allows injection of custom HTTP transports per auth entry.

Jump to

Keyboard shortcuts

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