mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-10 22:52:34 +01:00
✨ 数据同步支持接入第三方 WebDAV 服务 https://github.com/siyuan-note/siyuan/issues/6446
This commit is contained in:
parent
d7f6456424
commit
b6a1512105
6 changed files with 87 additions and 30 deletions
|
|
@ -17,14 +17,16 @@
|
|||
package conf
|
||||
|
||||
type Sync struct {
|
||||
CloudName string `json:"cloudName"` // 云端同步目录名称
|
||||
Enabled bool `json:"enabled"` // 是否开启同步
|
||||
Mode int `json:"mode"` // 同步模式,0:未设置(为兼容已有配置,initConf 函数中会转换为 1),1:自动,2:手动 https://github.com/siyuan-note/siyuan/issues/5089
|
||||
Synced int64 `json:"synced"` // 最近同步时间
|
||||
Stat string `json:"stat"` // 最近同步统计信息
|
||||
GenerateConflictDoc bool `json:"generateConflictDoc"` // 云端同步冲突时是否生成冲突文档
|
||||
Provider int `json:"provider"` // 云端存储服务提供者,0:思源官方,1:第三方七牛云,2:S3 协议对象存储
|
||||
OSS *OSS `json:"oss"` // 对象存储服务配置
|
||||
CloudName string `json:"cloudName"` // 云端同步目录名称
|
||||
Enabled bool `json:"enabled"` // 是否开启同步
|
||||
Mode int `json:"mode"` // 同步模式,0:未设置(为兼容已有配置,initConf 函数中会转换为 1),1:自动,2:手动 https://github.com/siyuan-note/siyuan/issues/5089
|
||||
Synced int64 `json:"synced"` // 最近同步时间
|
||||
Stat string `json:"stat"` // 最近同步统计信息
|
||||
GenerateConflictDoc bool `json:"generateConflictDoc"` // 云端同步冲突时是否生成冲突文档
|
||||
Provider int `json:"provider"` // 云端存储服务提供者
|
||||
Qiniu *Qiniu `json:"qiniu"` // 七牛云存储服务配置
|
||||
S3 *S3 `json:"s3"` // S3 对象存储服务配置
|
||||
WebDAV *WebDAV `json:"webdav"` // WebDAV 服务配置
|
||||
}
|
||||
|
||||
func NewSync() *Sync {
|
||||
|
|
@ -37,7 +39,14 @@ func NewSync() *Sync {
|
|||
}
|
||||
}
|
||||
|
||||
type OSS struct {
|
||||
type Qiniu struct {
|
||||
Endpoint string `json:"endpoint"` // 服务端点
|
||||
AccessKey string `json:"accessKey"` // Access Key
|
||||
SecretKey string `json:"secretKey"` // Secret Key
|
||||
Bucket string `json:"bucket"` // 存储空间
|
||||
}
|
||||
|
||||
type S3 struct {
|
||||
Endpoint string `json:"endpoint"` // 服务端点
|
||||
AccessKey string `json:"accessKey"` // Access Key
|
||||
SecretKey string `json:"secretKey"` // Secret Key
|
||||
|
|
@ -45,8 +54,15 @@ type OSS struct {
|
|||
Region string `json:"region"` // 存储区域
|
||||
}
|
||||
|
||||
type WebDAV struct {
|
||||
Endpoint string `json:"endpoint"` // 服务端点
|
||||
Username string `json:"username"` // 用户名
|
||||
Password string `json:"password"` // 密码
|
||||
}
|
||||
|
||||
const (
|
||||
ProviderSiYuan = 0
|
||||
ProviderQiniu = 1
|
||||
ProviderS3 = 2
|
||||
ProviderSiYuan = 0 // ProviderSiYuan 为思源官方提供的云端存储服务
|
||||
ProviderQiniu = 1 // ProviderQiniu 为第三方七牛云提供的云端存储服务
|
||||
ProviderS3 = 2 // ProviderS3 为 S3 协议对象存储提供的云端存储服务
|
||||
ProviderWebDAV = 3 // ProviderWebDAV 为 WebDAV 协议提供的云端存储服务
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue