Documentation
¶
Index ¶
- type Infra
- func (i *Infra) Close() error
- func (i *Infra) CreateOrUpdateProxyInfra(ctx context.Context, infra *ir.Infra) error
- func (i *Infra) CreateOrUpdateRateLimitInfra(ctx context.Context) error
- func (i *Infra) DeleteProxyInfra(ctx context.Context, infra *ir.Infra) error
- func (i *Infra) DeleteRateLimitInfra(ctx context.Context) error
- type InfraClient
- type InfraClientFactory
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 ¶
Close releases any resources held by the underlying InfraClient. It is a no-op if the client was never constructed.
func (*Infra) CreateOrUpdateProxyInfra ¶
CreateOrUpdateProxyInfra delegates to the underlying InfraClient.
func (*Infra) CreateOrUpdateRateLimitInfra ¶
CreateOrUpdateRateLimitInfra delegates to the underlying InfraClient.
func (*Infra) DeleteProxyInfra ¶
DeleteProxyInfra 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.