Pass the checksum type along in the request
This commit is contained in:
parent
d1485d7c5f
commit
7287b8e198
|
@ -7,9 +7,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type BackupRequest struct {
|
type BackupRequest struct {
|
||||||
Checksum string `json:"checksum"`
|
Checksum string `json:"checksum"`
|
||||||
Size int64 `json:"size"`
|
ChecksumType string `json:"checksum_type"`
|
||||||
Successful bool `json:"successful"`
|
Size int64 `json:"size"`
|
||||||
|
Successful bool `json:"successful"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notifies the panel that a specific backup has been completed and is now
|
// Notifies the panel that a specific backup has been completed and is now
|
||||||
|
|
|
@ -19,16 +19,18 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type ArchiveDetails struct {
|
type ArchiveDetails struct {
|
||||||
Checksum string `json:"checksum"`
|
Checksum string `json:"checksum"`
|
||||||
Size int64 `json:"size"`
|
ChecksumType string `json:"checksum_type"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns a request object.
|
// Returns a request object.
|
||||||
func (ad *ArchiveDetails) ToRequest(successful bool) api.BackupRequest {
|
func (ad *ArchiveDetails) ToRequest(successful bool) api.BackupRequest {
|
||||||
return api.BackupRequest{
|
return api.BackupRequest{
|
||||||
Checksum: ad.Checksum,
|
Checksum: ad.Checksum,
|
||||||
Size: ad.Size,
|
ChecksumType: ad.ChecksumType,
|
||||||
Successful: successful,
|
Size: ad.Size,
|
||||||
|
Successful: successful,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,8 +147,9 @@ func (b *Backup) Details() *ArchiveDetails {
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
return &ArchiveDetails{
|
return &ArchiveDetails{
|
||||||
Checksum: checksum,
|
Checksum: checksum,
|
||||||
Size: sz,
|
ChecksumType: "sha1",
|
||||||
|
Size: sz,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user