精简 API

This commit is contained in:
Aoran Zeng
2026-01-21 16:54:56 +08:00
parent 843ea9e755
commit 12134395c5
19 changed files with 96 additions and 91 deletions

View File

@@ -28,7 +28,7 @@ def_sources_end()
//
// 调整上述某一个镜像站的所提供源的 "换源链接"
chef_set_source_url (this, &UpstreamProvider, "新的换源链接");
chef_set_url (this, &UpstreamProvider, "新的换源链接");
```
<br>
@@ -59,14 +59,14 @@ def_sources_end()
//
// 调整/设置上述某一个镜像站的所提供源的 "精准测速链接"
chef_set_source_smurl (this, &UpstreamProvider, "新的测速链接")
chef_set_smurl (this, &UpstreamProvider, "新的测速链接")
// 把所有上述源的 "测速链接" 设置为 "换源链接" + postfix
chef_set_sources_speed_measure_url_with_postfix (this, "/dir/BigFile.tar.gz");
chef_set_all_smurl_with_postfix (this, "/dir/BigFile.tar.gz");
// 基于 "换源链接" 做更自定义的操作
chef_set_sources_speed_measure_url_with_func (this, func, data);
chef_set_all_smurl_with_func (this, func, data);
// 调整某一个镜像站(Provider)的 "测速链接"
chef_set_provider_speed_measure_url (&Tencent, "https://mirrors.cloud.tencent.com/npm/BigFile.tar.gz");
chef_set_provider_smurl (&Tencent, "https://mirrors.cloud.tencent.com/npm/BigFile.tar.gz");
// 调整某一个镜像站(Provider)的 "测速精度"
chef_set_provider_speed_measure_accuracy (&UpstreamProvider, ROUGH);
chef_set_provider_sm_accuracy (&UpstreamProvider, ROUGH);
```