radius

package
v0.31.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 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) (armrpc_controller.Controller, error)

Function Explanation

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.Plane, datamodel.Plane]
	// contains filtered or unexported fields
}

ProxyController is the controller implementation to proxy requests to appropriate RP or URL.

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

Function Explanation

Run() takes in a request object and context, looks up the plane and resource provider associated with the request, and proxies the request to the appropriate resource provider.

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, downstream string, id 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