proxy

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package proxy provides an ordinary custom handler for explicitly configured HTTP forwarding. Native input binding and runtime lifecycle rules apply.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() xhandler.Contract[Input, Output]

Types

type Config

type Config struct {
	Client       xhttp.Options `json:"client"`
	Headers      []Header      `json:"headers,omitempty"`
	ForwardQuery bool          `json:"forwardQuery,omitempty"`
	ForwardBody  bool          `json:"forwardBody,omitempty"`
}

Config is deployment-owned forwarding policy. Nothing from the incoming request selects the destination or is forwarded without these options.

type Handler

type Handler struct{}

func (*Handler) Exec

func (*Handler) Exec(ctx context.Context, _ xhandler.Session, input *Input, output *Output) error
type Header struct{ From, To string }

type Input

type Input struct {
	Config  *Config        `parameter:"Config,kind=const,in=Proxy,required"`
	HTTP    xhttp.Provider `bind:"kind=http_client,required"`
	Request *http.Request  `parameter:"Request,kind=http_request,required"`
}

func (*Input) Init

func (i *Input) Init(context.Context) error

Init is the same input initialization hook available to application handlers.

type Output

type Output struct{ response.Response }

Jump to

Keyboard shortcuts

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