Help us shape the future of Go! Take the 2026 Go Developer Survey

radius

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlanesPath = "/planes"

	// ProcessOperationTimeout is the timeout for processing a tracked resource in the background.
	ProcessOperationTimeout = 12 * time.Hour

	// ProcessOperationRetryAfter is the retry interval for processing a tracked resource in the background.
	// This is used when the tracked resource is not in a terminal state.
	ProcessOperationRetryAfter = 5 * time.Second

	// EnqueueOperationRetryCount is the number of times to retry enqueueing an async operation before giving up.
	EnqueueOperationRetryCount = 10
)

Variables

This section is empty.

Functions

func NewProxyController

func NewProxyController(opts armrpc_controller.Options, transport http.RoundTripper, defaultDownstream string) (armrpc_controller.Controller, error)

NewProxyController creates a new ProxyPlane controller with the given options and returns it, or returns an error if the controller cannot be created.

Types

type ProxyController

type ProxyController struct {
	armrpc_controller.Operation[*datamodel.RadiusPlane, datamodel.RadiusPlane]
	// contains filtered or unexported fields
}

ProxyController is the controller implementation to proxy requests to appropriate RP in Radius.

func (*ProxyController) EnqueueTrackedResourceUpdate

func (p *ProxyController) EnqueueTrackedResourceUpdate(ctx context.Context, id resources.ID, apiVersion string) error

EnqueueTrackedResourceUpdate enqueues an async operation to update the tracked resource.

func (*ProxyController) IsTerminalResponse

func (p *ProxyController) IsTerminalResponse(resp *http.Response) bool

IsTerminalResponse returns true if the response is terminal.

func (*ProxyController) PrepareProxyRequest

func (p *ProxyController) PrepareProxyRequest(ctx context.Context, originalReq *http.Request, downstream string, relativePath string) (*http.Request, error)

PrepareProxyRequest constructs and initializes the proxy request.

func (*ProxyController) Run

Run processes incoming HTTP requests by proxying them to a downstream resource provider or external system.

func (*ProxyController) ShouldTrackRequest

func (p *ProxyController) ShouldTrackRequest(httpMethod string, id resources.ID, resp *http.Response) bool

ShouldTrackRequest returns true if the request should be tracked.

func (*ProxyController) UpdateTrackedResource

func (p *ProxyController) UpdateTrackedResource(ctx context.Context, downstreamURL string, originalID resources.ID, apiVersion string) error

UpdateTrackedResource updates the tracked resource synchronously.

Jump to

Keyboard shortcuts

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