Skip to content

Commit bb8bbf8

Browse files
authored
Merge pull request #92 from volcengine/release_v2.9.1
release_v2.9.1
2 parents 38ae995 + cd9b526 commit bb8bbf8

23 files changed

Lines changed: 3729 additions & 18 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# ChangeLog of TOS SDK for Go
2+
## 版本号 v2.9.1 日期:2026-02-25
3+
- 新增 object set 相关接口
4+
- 计算签名时移除对 date 字段的依赖
5+
26
## 版本号 v2.9.0 日期:2025-12-10
37
- 默认开启 DNS 缓存
48
- PreSignedURLInput 支持签名输入 header

tos/check.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,27 @@ func isValidSSECAlgorithm(algorithm string) error {
125125
}
126126
return InvalidSSECAlgorithm
127127
}
128+
129+
func IsValidVectorsBucketName(name string) error {
130+
if length := len(name); length < 3 || length > 32 {
131+
return InvalidVectorsBucketNameLength
132+
}
133+
for i := range name {
134+
if char := name[i]; !(('a' <= char && char <= 'z') || ('0' <= char && char <= '9') || char == '-') {
135+
return InvalidVectorsBucketNameCharacter
136+
}
137+
}
138+
if name[0] == '-' || name[len(name)-1] == '-' {
139+
return InvalidBucketNameStartingOrEnding
140+
}
141+
return nil
142+
}
143+
144+
func IsValidAccountID(accountID string) error {
145+
for i := range accountID {
146+
if char := accountID[i]; !('0' <= char && char <= '9') {
147+
return InvalidAccountID
148+
}
149+
}
150+
return nil
151+
}

tos/consts.go

Lines changed: 3 additions & 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.0"
10+
Version = "v2.9.1"
1111
)
1212

1313
const TempFileSuffix = ".temp"
@@ -197,3 +197,5 @@ const (
197197
HeaderTosModifyTimestamp = "X-Tos-Modify-Timestamp"
198198
HeaderTosModifyTimestampNs = "X-Tos-Modify-Timestamp-Ns"
199199
)
200+
201+
const VectorServiceName = "tosvectors"

tos/enum/enum.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,19 @@ const (
317317
NetworkOriginInternet NetworkOriginType = "internet"
318318
)
319319

320+
type DataType string
321+
322+
const (
323+
DataTypeFloat32 DataType = "float32"
324+
)
325+
326+
type DistanceMetricType string
327+
328+
const (
329+
DistanceMetricEuclidean DistanceMetricType = "euclidean"
330+
DistanceMetricCosine DistanceMetricType = "cosine"
331+
)
332+
320333
type AuthProtocolType string
321334

322335
const (

tos/error.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ var (
4545
InvalidCompleteAllPartsLength = newTosClientError("Should not specify both complete all and Parts", nil)
4646
InvalidPartsLength = newTosClientError("You must specify at least one part", nil)
4747
InvlidDeleteMultiObjectsLength = newTosClientError("You must specify at least one object", nil)
48+
InvalidVectorsBucketNameLength = newTosClientError("invalid vectors bucket name, the length must be [3, 32]", nil)
49+
InvalidVectorsBucketNameCharacter = newTosClientError("invalid vectors bucket name, the character set is illegal", nil)
50+
InvalidVectorsBucketNameStartingOrEnding = newTosClientError("invalid vectors bucket name, the vectors bucket name can be neither starting with '-' nor ending with '-'", nil)
51+
InvalidAccountID = newTosClientError("invalid account id, the account id must be a number", nil)
4852
)
4953

5054
type TosError struct {

0 commit comments

Comments
 (0)