Documentation
¶
Index ¶
- func DownloadFile(ac *client.AlpaconClient, sources []string, dest, username, groupname string, ...) error
- func DownloadFileContent(ac *client.AlpaconClient, ...) ([]byte, error)
- func UploadContentAs(ac *client.AlpaconClient, serverName, remotePath string, content []byte, ...) 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
- func UploadLocalFileAs(ac *client.AlpaconClient, ...) error
- type BulkDownloadRequest
- type BulkDownloadResponse
- type BulkUploadRequest
- type BulkUploadTriggerRequest
- type DownloadRequest
- type DownloadResponse
- type DownloadedFile
- 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, workSessionID string) 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. workSessionID is optional; when non-empty it is attached to the request body.
func DownloadFileContent ¶ added in v1.17.0
func DownloadFileContent(ac *client.AlpaconClient, serverName, remotePath, username, groupname, workSessionID string, limit int64) ([]byte, error)
DownloadFileContent reads one remote file into memory, at most limit bytes of it: a caller that refuses anything larger learns so from limit+1 without the whole file crossing the network or touching the disk.
func UploadContentAs ¶ added in v1.17.0
func UploadContentAs(ac *client.AlpaconClient, serverName, remotePath string, content []byte, username, groupname, workSessionID string, allowOverwrite bool) error
UploadContentAs writes content to the exact remote file path as username and groupname. It sends the bytes it is given rather than reopening a local file, so a caller that hashes or submits the same bytes knows they are what landed on the server. Without allowOverwrite the agent refuses an existing file.
func UploadFile ¶
func UploadFile(ac *client.AlpaconClient, src []string, dest, username, groupname string, allowOverwrite bool, workSessionID string) error
UploadFile uploads local files to a remote server. Uses the single upload API for one file, or the bulk API for multiple files. workSessionID is optional; when non-empty it is attached to the request body.
func UploadFolder ¶
func UploadFolder(ac *client.AlpaconClient, src []string, dest, username, groupname string, allowOverwrite bool, workSessionID string) 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. workSessionID is optional; when non-empty it is attached to the request body.
func UploadLocalFileAs ¶ added in v1.6.0
func UploadLocalFileAs(ac *client.AlpaconClient, localPath, serverName, remotePath, username, groupname, workSessionID string) error
UploadLocalFileAs uploads one local file to the exact remote file path, whatever the local file is named.
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 BulkUploadRequest struct {
Names []string `json:"names"`
Path string `json:"path"`
Server string `json:"server"`
Username string `json:"username"`
Groupname string `json:"groupname"`
AllowOverwrite bool `json:"allow_overwrite"`
AllowUnzip bool `json:"allow_unzip"`
WorkSession string `json:"work_session,omitempty"`
}
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 DownloadedFile ¶ added in v1.6.0
func DownloadFileToPath ¶ added in v1.6.0
func DownloadFileToPath(ac *client.AlpaconClient, serverName, remotePath, localPath, username, groupname, workSessionID string) (DownloadedFile, error)
type TransferStatusResponse ¶ added in v1.0.0
type UploadRequest ¶
type UploadRequest struct {
Name string `json:"name"`
Path string `json:"path"`
Server string `json:"server"`
Username string `json:"username"`
Groupname string `json:"groupname"`
AllowOverwrite bool `json:"allow_overwrite"`
AllowUnzip bool `json:"allow_unzip"`
WorkSession string `json:"work_session,omitempty"`
}
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"`
}