Documentation
¶
Index ¶
- func DownloadFile(ac *client.AlpaconClient, sources []string, dest, username, groupname string, ...) error
- func PollTransferStatus(ac *client.AlpaconClient, transferType, id string, timeout time.Duration) (bool, string, error)
- func UploadFile(ac *client.AlpaconClient, src []string, dest, username, groupname string, ...) error
- func UploadFolder(ac *client.AlpaconClient, src []string, dest, username, groupname string, ...) error
- type BulkDownloadRequest
- type BulkDownloadResponse
- type BulkUploadRequest
- type BulkUploadTriggerRequest
- type DownloadRequest
- type DownloadResponse
- type TransferErrorResponse
- type TransferStatusResponse
- type UploadRequest
- type UploadResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
func DownloadFile(ac *client.AlpaconClient, sources []string, dest, username, groupname string, recursive bool) error
DownloadFile downloads files from a remote server. Each source should be in "server:/path" format. Uses the bulk API for multiple files, or the single-file API for a single file.
func PollTransferStatus ¶ added in v1.0.0
func PollTransferStatus(ac *client.AlpaconClient, transferType, id string, timeout time.Duration) (bool, string, error)
PollTransferStatus polls the transfer status API until success/failure or timeout. transferType should be "upload" or "download", id is the transfer ID. timeout controls how long to poll before giving up. Returns true if transfer succeeded, false if failed, and error if polling timed out or failed.
func UploadFile ¶
func UploadFile(ac *client.AlpaconClient, src []string, dest, username, groupname string, allowOverwrite bool) error
UploadFile uploads local files to a remote server. Uses the single upload API for one file, or the bulk API for multiple files.
func UploadFolder ¶
func UploadFolder(ac *client.AlpaconClient, src []string, dest, username, groupname string, allowOverwrite bool) error
UploadFolder uploads local folders to a remote server. Each folder is zipped before upload and extracted on the server side. Uses the single upload API for one folder, or the bulk API for multiple folders.
Types ¶
type BulkDownloadRequest ¶ added in v1.4.2
type BulkDownloadResponse ¶ added in v1.4.2
type BulkDownloadResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Path []string `json:"path"`
Size int `json:"size"`
Server types.ServerSummary `json:"server"`
User string `json:"user"`
Username string `json:"username"`
Groupname string `json:"groupname"`
ExpiresAt string `json:"expires_at"`
UploadURL string `json:"upload_url"`
DownloadURL string `json:"download_url"`
Command string `json:"command"`
}
type BulkUploadRequest ¶ added in v1.4.2
type BulkUploadTriggerRequest ¶ added in v1.4.2
type BulkUploadTriggerRequest struct {
IDs []string `json:"ids"`
}
type DownloadRequest ¶
type DownloadResponse ¶
type DownloadResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Size int `json:"size"`
Server types.ServerSummary `json:"server"`
User string `json:"user"`
Username string `json:"username"`
Groupname string `json:"groupname"`
ExpiresAt string `json:"expires_at"`
UploadURL string `json:"upload_url"`
DownloadURL string `json:"download_url"`
Command string `json:"command"`
}
type TransferErrorResponse ¶ added in v1.0.0
type TransferErrorResponse struct {
Code string `json:"code"`
}
type TransferStatusResponse ¶ added in v1.0.0
type UploadRequest ¶
type UploadResponse ¶
type UploadResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Size int `json:"size"`
Server types.ServerSummary `json:"server"`
User string `json:"user"`
Username string `json:"username"`
Groupname string `json:"groupname"`
ExpiresAt string `json:"expires_at"`
UploadURL string `json:"upload_url"`
Command string `json:"command"`
}