remote

package
v1.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Infra

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

Infra manages the creation and deletion of remotely managed proxy and rate limit infrastructure by delegating to a remote provider over gRPC.

The underlying InfraClient is constructed lazily on the first method call that requires it. This avoids dialing the remote service or reading Kubernetes secrets during process startup, where failures would crash the pod before validation that the remote provider is actually being used.

func NewInfra

func NewInfra(factory InfraClientFactory) *Infra

NewInfra returns a new Infra that will lazily build its InfraClient via the provided factory. The factory is invoked at most once for a successful construction; if it returns an error, the next call will retry.

func (*Infra) Close

func (i *Infra) Close() error

Close releases any resources held by the underlying InfraClient. It is a no-op if the client was never constructed.

func (*Infra) CreateOrUpdateProxyInfra

func (i *Infra) CreateOrUpdateProxyInfra(ctx context.Context, infra *ir.Infra) error

CreateOrUpdateProxyInfra delegates to the underlying InfraClient.

func (*Infra) CreateOrUpdateRateLimitInfra

func (i *Infra) CreateOrUpdateRateLimitInfra(ctx context.Context) error

CreateOrUpdateRateLimitInfra delegates to the underlying InfraClient.

func (*Infra) DeleteProxyInfra

func (i *Infra) DeleteProxyInfra(ctx context.Context, infra *ir.Infra) error

DeleteProxyInfra delegates to the underlying InfraClient.

func (*Infra) DeleteRateLimitInfra

func (i *Infra) DeleteRateLimitInfra(ctx context.Context) error

DeleteRateLimitInfra delegates to the underlying InfraClient.

type InfraClient

type InfraClient interface {
	Close() error
	CreateOrUpdateProxyInfra(ctx context.Context, infra *ir.Infra) error
	DeleteProxyInfra(ctx context.Context, infra *ir.Infra) error
	CreateOrUpdateRateLimitInfra(ctx context.Context) error
	DeleteRateLimitInfra(ctx context.Context) error
}

InfraClient is the contract used by Infra to talk to a remote infrastructure provider.

type InfraClientFactory

type InfraClientFactory func(ctx context.Context) (InfraClient, error)

InfraClientFactory builds an InfraClient on demand. Infra invokes the factory lazily on the first method call that needs the client.

func DefaultInfraClientFactory

func DefaultInfraClientFactory(cfg *config.Server, k8sClient k8scli.Client) InfraClientFactory

DefaultInfraClientFactory returns an InfraClientFactory that defers construction of the remote gRPC client until the factory is invoked.

Jump to

Keyboard shortcuts

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