Package io.github.easy4j.opencode
Class OpenCodeOkHttpClientFactory
java.lang.Object
io.github.easy4j.opencode.OpenCodeOkHttpClientFactory
Factory for creating
OkHttpClient instances used by the OpenCode SDK in standalone mode.
When a Spring container already provides an external OkHttpClient, the injection
constructors should be used instead and this factory will not participate.
- Since:
- 1.0.0
- Author:
- Loong Wan
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic okhttp3.OkHttpClientcreate(OpenCodeHttpClientConfig config) 根据 OpenCode HTTP 配置创建客户端。static voidshutdown(okhttp3.OkHttpClient client) 释放 SDK 自建客户端资源。
-
Method Details
-
create
根据 OpenCode HTTP 配置创建客户端。- Parameters:
config- 客户端配置;不得为null- Returns:
- OpenCode SDK 返回的OkHttp 客户端对象
-
shutdown
public static void shutdown(okhttp3.OkHttpClient client) 释放 SDK 自建客户端资源。- Parameters:
client- SDK 自建客户端
-