feat(ks3): add KS3 object storage support
Add Kingsoft Cloud KS3 as a supported storage provider, including backend service implementation, storage config UI, and provider scheme recognition throughout the codebase.
This commit is contained in:
@@ -170,7 +170,7 @@ func (c ChunkingConfig) ResolveParserEngine(fileType string) string {
|
||||
// StorageProviderConfig stores the KB-level storage provider selection.
|
||||
// Credentials are managed at the tenant level (StorageEngineConfig).
|
||||
type StorageProviderConfig struct {
|
||||
Provider string `yaml:"provider" json:"provider"` // "local", "minio", "cos", "tos", "s3", "oss"
|
||||
Provider string `yaml:"provider" json:"provider"` // "local", "minio", "cos", "tos", "s3", "oss", "ks3"
|
||||
}
|
||||
|
||||
func (c StorageProviderConfig) Value() (driver.Value, error) {
|
||||
@@ -284,7 +284,7 @@ func InferStorageFromFilePath(filePath string) string {
|
||||
// e.g. "minio://bucket/key" → "minio", "local://tenant/file.pdf" → "local"
|
||||
// Returns "" if the path does not use a known provider scheme.
|
||||
func ParseProviderScheme(filePath string) string {
|
||||
for _, provider := range []string{"local", "minio", "cos", "tos", "s3", "oss"} {
|
||||
for _, provider := range []string{"local", "minio", "cos", "tos", "s3", "oss", "ks3"} {
|
||||
if strings.HasPrefix(filePath, provider+"://") {
|
||||
return provider
|
||||
}
|
||||
|
||||
@@ -402,16 +402,17 @@ func (c *ParserEngineConfig) Scan(value interface{}) error {
|
||||
return json.Unmarshal(b, c)
|
||||
}
|
||||
|
||||
// StorageEngineConfig holds tenant-level storage engine parameters for Local, MinIO, COS, TOS, S3, and OSS.
|
||||
// StorageEngineConfig holds tenant-level storage engine parameters for Local, MinIO, COS, TOS, S3, OSS, and KS3.
|
||||
// Knowledge bases select which provider to use; parameters are read from here.
|
||||
type StorageEngineConfig struct {
|
||||
DefaultProvider string `json:"default_provider"` // "local", "minio", "cos", "tos", "s3", "oss"
|
||||
DefaultProvider string `json:"default_provider"` // "local", "minio", "cos", "tos", "s3", "oss", "ks3"
|
||||
Local *LocalEngineConfig `json:"local,omitempty"`
|
||||
MinIO *MinIOEngineConfig `json:"minio,omitempty"`
|
||||
COS *COSEngineConfig `json:"cos,omitempty"`
|
||||
TOS *TOSEngineConfig `json:"tos,omitempty"`
|
||||
S3 *S3EngineConfig `json:"s3,omitempty"`
|
||||
OSS *OSSEngineConfig `json:"oss,omitempty"`
|
||||
KS3 *KS3EngineConfig `json:"ks3,omitempty"`
|
||||
}
|
||||
|
||||
// LocalEngineConfig is for local file system storage (single-machine deployment only).
|
||||
@@ -474,6 +475,16 @@ type OSSEngineConfig struct {
|
||||
TempRegion string `json:"temp_region"`
|
||||
}
|
||||
|
||||
// KS3EngineConfig is for Kingsoft Cloud KS3 object storage.
|
||||
type KS3EngineConfig struct {
|
||||
Endpoint string `json:"endpoint"`
|
||||
Region string `json:"region"`
|
||||
AccessKey string `json:"access_key"`
|
||||
SecretKey string `json:"secret_key"`
|
||||
BucketName string `json:"bucket_name"`
|
||||
PathPrefix string `json:"path_prefix"`
|
||||
}
|
||||
|
||||
// Value implements the driver.Valuer interface for StorageEngineConfig
|
||||
func (c *StorageEngineConfig) Value() (driver.Value, error) {
|
||||
if c == nil {
|
||||
|
||||
Reference in New Issue
Block a user