Versions in this module Expand all Collapse all v0 v0.0.2 Mar 26, 2023 v0.0.1 Mar 26, 2023 Changes in this version + var ErrCloudAuthFailed = errors.New("cloud account auth failed") + var ErrCloudObjectNotFound = errors.New("cloud object not found") + var ErrCloudServiceUnavailable = errors.New("cloud service unavailable") + var ErrSystemTimeIncorrect = errors.New("system time incorrect") + var ErrUnsupported = errors.New("not supported yet") + func IsValidCloudDirName(cloudDirName string) bool + type BaseCloud struct + func (baseCloud *BaseCloud) AddTraffic(uploadBytes, downloadBytes int64) + func (baseCloud *BaseCloud) CreateRepo(name string) (err error) + func (baseCloud *BaseCloud) DownloadObject(filePath string) (data []byte, err error) + func (baseCloud *BaseCloud) GetAvailableSize() (size int64) + func (baseCloud *BaseCloud) GetChunks(checkChunkIDs []string) (chunkIDs []string, err error) + func (baseCloud *BaseCloud) GetConf() *Conf + func (baseCloud *BaseCloud) GetRefsFiles() (fileIDs []string, err error) + func (baseCloud *BaseCloud) GetRepos() (repos []*Repo, size int64, err error) + func (baseCloud *BaseCloud) GetStat() (stat *Stat, err error) + func (baseCloud *BaseCloud) GetTags() (tags []*Ref, err error) + func (baseCloud *BaseCloud) RemoveObject(key string) (err error) + func (baseCloud *BaseCloud) RemoveRepo(name string) (err error) + func (baseCloud *BaseCloud) UploadObject(filePath string, overwrite bool) (err error) + type Cloud interface + AddTraffic func(uploadBytes, downloadBytes int64) + CreateRepo func(name string) (err error) + DownloadObject func(filePath string) (data []byte, err error) + GetAvailableSize func() (size int64) + GetChunks func(checkChunkIDs []string) (chunkIDs []string, err error) + GetConf func() *Conf + GetRefsFiles func() (fileIDs []string, err error) + GetRepos func() (repos []*Repo, size int64, err error) + GetStat func() (stat *Stat, err error) + GetTags func() (tags []*Ref, err error) + RemoveObject func(filePath string) (err error) + RemoveRepo func(name string) (err error) + UploadObject func(filePath string, overwrite bool) (err error) + type Conf struct + AvailableSize int64 + Dir string + Endpoint string + Extras map[string]interface{} + RepoPath string + S3 *ConfS3 + Server string + Token string + UserID string + WebDAV *ConfWebDAV + type ConfS3 struct + AccessKey string + Bucket string + Endpoint string + PathStyle bool + Region string + SecretKey string + SkipTlsVerify bool + Timeout int + type ConfWebDAV struct + Endpoint string + Password string + SkipTlsVerify bool + Timeout int + Username string + type Ref struct + ID string + Name string + Updated string + type Repo struct + Name string + Size int64 + Updated string + type S3 struct + HTTPClient *http.Client + func NewS3(baseCloud *BaseCloud, httpClient *http.Client) *S3 + func (s3 *S3) DownloadObject(filePath string) (data []byte, err error) + func (s3 *S3) GetChunks(checkChunkIDs []string) (chunkIDs []string, err error) + func (s3 *S3) GetRefsFiles() (fileIDs []string, err error) + func (s3 *S3) GetRepos() (repos []*Repo, size int64, err error) + func (s3 *S3) GetTags() (tags []*Ref, err error) + func (s3 *S3) RemoveObject(key string) (err error) + func (s3 *S3) UploadObject(filePath string, overwrite bool) (err error) + type SiYuan struct + func NewSiYuan(baseCloud *BaseCloud) *SiYuan + func (siyuan *SiYuan) AddTraffic(uploadBytes, downloadBytes int64) + func (siyuan *SiYuan) CreateRepo(name string) (err error) + func (siyuan *SiYuan) DownloadObject(filePath string) (ret []byte, err error) + func (siyuan *SiYuan) GetChunks(excludeChunkIDs []string) (chunkIDs []string, err error) + func (siyuan *SiYuan) GetRefsFiles() (fileIDs []string, err error) + func (siyuan *SiYuan) GetRepos() (repos []*Repo, size int64, err error) + func (siyuan *SiYuan) GetStat() (stat *Stat, err error) + func (siyuan *SiYuan) GetTags() (tags []*Ref, err error) + func (siyuan *SiYuan) RemoveObject(filePath string) (err error) + func (siyuan *SiYuan) RemoveRepo(name string) (err error) + func (siyuan *SiYuan) UploadObject(filePath string, overwrite bool) (err error) + type Stat struct + AssetSize int64 + Backup *StatBackup + RepoCount int + Sync *StatSync + type StatBackup struct + Count int + FileCount int + Size int64 + Updated string + type StatSync struct + FileCount int + Size int64 + Updated string + type UploadToken struct + type WebDAV struct + Client *gowebdav.Client + func NewWebDAV(baseCloud *BaseCloud, client *gowebdav.Client) (ret *WebDAV) + func (webdav *WebDAV) DownloadObject(filePath string) (data []byte, err error) + func (webdav *WebDAV) GetChunks(checkChunkIDs []string) (chunkIDs []string, err error) + func (webdav *WebDAV) GetRefsFiles() (fileIDs []string, err error) + func (webdav *WebDAV) GetRepos() (repos []*Repo, size int64, err error) + func (webdav *WebDAV) GetTags() (tags []*Ref, err error) + func (webdav *WebDAV) RemoveObject(filePath string) (err error) + func (webdav *WebDAV) UploadObject(filePath string, overwrite bool) (err error)