Get transfers 'fully' working, need to add fail request though

This commit is contained in:
Matthew Penner
2020-04-04 16:15:49 -06:00
parent 8bd7708631
commit 6af3cb2c9b
4 changed files with 91 additions and 3 deletions

View File

@@ -146,3 +146,33 @@ func (r *PanelRequest) SendArchiveStatus(uuid string, successful bool) (*Request
return nil, nil
}
func (r *PanelRequest) SendTransferFailure(uuid string) (*RequestError, error) {
resp, err := r.Get(fmt.Sprintf("/servers/%s/transfer/failure", uuid))
if err != nil {
return nil, errors.WithStack(err)
}
defer resp.Body.Close()
r.Response = resp
if r.HasError() {
return r.Error(), nil
}
return nil, nil
}
func (r *PanelRequest) SendTransferSuccess(uuid string) (*RequestError, error) {
resp, err := r.Get(fmt.Sprintf("/servers/%s/transfer/success", uuid))
if err != nil {
return nil, errors.WithStack(err)
}
defer resp.Body.Close()
r.Response = resp
if r.HasError() {
return r.Error(), nil
}
return nil, nil
}