Skip to content

Commit 6113a18

Browse files
authored
Merge pull request #94 from volcengine/release_v2.9.3
v2.9.3
2 parents d433f78 + 355a06a commit 6113a18

7 files changed

Lines changed: 40 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# ChangeLog of TOS SDK for Go
2+
## 版本号 v2.9.3 日期:2026-04-23
3+
- VideoDataProcess 增加 PCM 处理
4+
25
## 版本号 v2.9.2 日期:2026-04-08
36
- SemanticQuery 增加 Caption、Description
47

tos/consts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
const (
99
// Version tos-go-sdk version
10-
Version = "v2.9.2"
10+
Version = "v2.9.3"
1111
)
1212

1313
const TempFileSuffix = ".temp"

tos/dns_cache.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ func (c *cache) Get(key string) ([]string, bool) {
129129
if !data.keepAlive && data.expireAt.Before(time.Now()) {
130130
return nil, false
131131
}
132-
return data.ipList, true
132+
// 返回拷贝,避免调用方对 cache 内部切片做原地修改(例如 rand.Shuffle)
133+
// 造成多 goroutine 间的 data race。
134+
ipList := make([]string, len(data.ipList))
135+
copy(ipList, data.ipList)
136+
return ipList, true
133137
}
134138

135139
func (c *cache) cleanCache() {

tos/enum/enum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ type DistanceMetricType string
327327

328328
const (
329329
DistanceMetricEuclidean DistanceMetricType = "euclidean"
330-
DistanceMetricCosine DistanceMetricType = "cosine"
330+
DistanceMetricCosine DistanceMetricType = "cosine"
331331
)
332332

333333
type AuthProtocolType string

tos/object.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,11 +1595,10 @@ func (cli *ClientV2) VideoDataProcess(ctx context.Context, input *VideoDataProce
15951595

15961596
process := input.Process
15971597

1598-
if !strings.HasPrefix(process, "x-tos-post-process=video/snapshots,") {
1598+
if !strings.HasPrefix(process, "x-tos-post-process=") {
15991599
process = "x-tos-post-process=video/snapshots," + process
16001600
}
16011601

1602-
16031602
res, err := cli.newBuilder(input.Bucket, input.Key).
16041603
SetGeneric(input.GenericInput).
16051604
WithQuery("x-tos-post-process", "").

tos/transport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (d *TimeoutDialer) DialContext(ctx context.Context, network, address string
312312
return nil, err
313313
}
314314

315-
// 随机打乱 IP List
315+
// 随机打乱 IP List(cache.Get 已返回拷贝,可安全原地打乱)
316316
rand.Shuffle(len(ipList), func(i, j int) {
317317
ipList[i], ipList[j] = ipList[j], ipList[i]
318318
})

tos/type.go

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ type ObjectSetQuotaRule struct {
26722672
}
26732673

26742674
type PutObjectSetQuotaByTagInput struct {
2675-
GenericInput `json:"-"` // v2.8.0
2675+
GenericInput `json:"-"` // v2.8.0
26762676
Bucket string `json:"-"` // required
26772677
Rules []ObjectSetQuotaRule `json:"Rules"`
26782678
}
@@ -2682,8 +2682,8 @@ type PutObjectSetQuotaByTagOutput struct {
26822682
}
26832683

26842684
type GetObjectSetQuotaByTagInput struct {
2685-
GenericInput `json:"-"` // v2.8.0
2686-
Bucket string `json:"-"` // required
2685+
GenericInput `json:"-"` // v2.8.0
2686+
Bucket string `json:"-"` // required
26872687
}
26882688

26892689
type GetObjectSetQuotaByTagOutput struct {
@@ -2692,29 +2692,29 @@ type GetObjectSetQuotaByTagOutput struct {
26922692
}
26932693

26942694
type DeleteObjectSetQuotaByTagInput struct {
2695-
GenericInput `json:"-"` // v2.8.0
2696-
Bucket string `json:"-"` // required
2695+
GenericInput `json:"-"` // v2.8.0
2696+
Bucket string `json:"-"` // required
26972697
}
26982698

26992699
type DeleteObjectSetQuotaByTagOutput struct {
27002700
RequestInfo
27012701
}
27022702

27032703
type PutObjectSetQuotaInput struct {
2704-
GenericInput `json:"-"` // v2.8.0
2705-
Bucket string `json:"-"` // required
2706-
ObjectSetName string `location:"query" locationName:"ObjectSetName" json:"-"`
2707-
StorageQuota string `json:"StorageQuota"`
2704+
GenericInput `json:"-"` // v2.8.0
2705+
Bucket string `json:"-"` // required
2706+
ObjectSetName string `location:"query" locationName:"ObjectSetName" json:"-"`
2707+
StorageQuota string `json:"StorageQuota"`
27082708
}
27092709

27102710
type PutObjectSetQuotaOutput struct {
27112711
RequestInfo
27122712
}
27132713

27142714
type GetObjectSetQuotaInput struct {
2715-
GenericInput `json:"-"` // v2.8.0
2716-
Bucket string `json:"-"` // required
2717-
ObjectSetName string `location:"query" locationName:"ObjectSetName" json:"-"`
2715+
GenericInput `json:"-"` // v2.8.0
2716+
Bucket string `json:"-"` // required
2717+
ObjectSetName string `location:"query" locationName:"ObjectSetName" json:"-"`
27182718
}
27192719

27202720
type GetObjectSetQuotaOutput struct {
@@ -2723,9 +2723,9 @@ type GetObjectSetQuotaOutput struct {
27232723
}
27242724

27252725
type GetObjectSetStorageInput struct {
2726-
GenericInput `json:"-"` // v2.8.0
2727-
Bucket string `json:"-"` // required
2728-
ObjectSetName string `location:"query" locationName:"ObjectSetName" json:"-"`
2726+
GenericInput `json:"-"` // v2.8.0
2727+
Bucket string `json:"-"` // required
2728+
ObjectSetName string `location:"query" locationName:"ObjectSetName" json:"-"`
27292729
}
27302730

27312731
type StorageStat struct {
@@ -3441,6 +3441,12 @@ type VideoDataProcessInput struct {
34413441
// VideoDataProcessOutput 视频数据处理响应参数
34423442
type VideoDataProcessOutput struct {
34433443
RequestInfo
3444+
VideoSnapshotsOutput
3445+
PcmDataProcessOutput
3446+
}
3447+
3448+
// VideoSnapshotsOutput 视频快照(video/snapshots)处理返回字段
3449+
type VideoSnapshotsOutput struct {
34443450
OutputBucket string
34453451
TotalFrameCount int
34463452
SuccFrameCount int
@@ -3449,6 +3455,13 @@ type VideoDataProcessOutput struct {
34493455
FailFrameList []FailFrame
34503456
}
34513457

3458+
// PcmDataProcessOutput 音频 PCM 转码(audio/pcm)处理返回字段
3459+
type PcmDataProcessOutput struct {
3460+
PcmBucket string `json:"bucket,omitempty"`
3461+
PcmObject string `json:"object,omitempty"`
3462+
PcmStatus string `json:"status,omitempty"`
3463+
}
3464+
34523465
// SuccFrame 成功的帧信息
34533466
type SuccFrame struct {
34543467
FrameIndex int

0 commit comments

Comments
 (0)