GatewayStrategy
public class GatewayStrategy implements ConnectionStrategy
源码Source
io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:39–165网关 Strategy,在隔离环境中安全执行代码和工具。位于 io.agentscope.extensions.sandbox.kubernetes.client.internal.strategy 包,实现 ConnectionStrategy。核心成员包括 connect、close、GatewayStrategy。
Gateway connection strategy — watches a Kubernetes Gateway resource for an external address, then routes through the sandbox-router.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public GatewayStrategy(KubernetesClient client, GatewayConnectionConfig config) | 初始化 `GatewayStrategy` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String connect() throws Exception | 建立连接并完成初始化。 Returns the connect. |
public void close() | 关闭连接并释放相关资源。 Releases resources and connections. |
构造器详情Constructor Detail
GatewayStrategy
public GatewayStrategy(KubernetesClient client, GatewayConnectionConfig config)
初始化 GatewayStrategy 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | KubernetesClient | 客户端(类型 `KubernetesClient`)。The client. |
config | GatewayConnectionConfig | 配置对象(类型 `GatewayConnectionConfig`)。The config. |
源码Source
io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:56–59方法详情Method Detail
connect
public String connect() throws Exception
建立连接并完成初始化。
Returns the connect.
String返回字符串结果。Returns a string.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:61–111close
public void close()
关闭连接并释放相关资源。
Releases resources and connections.
源码Source
io/agentscope/extensions/sandbox/kubernetes/client/internal/strategy/GatewayStrategy.java:113–116