ftp

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 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, 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. It preserves the remote basename instead of deriving the destination name from the local temp file name.

Types

type BulkDownloadRequest added in v1.4.2

type BulkDownloadRequest struct {
	Path        []string `json:"path"`
	Server      string   `json:"server"`
	Username    string   `json:"username"`
	Groupname   string   `json:"groupname"`
	WorkSession string   `json:"work_session,omitempty"`
}

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 DownloadRequest struct {
	Path         string `json:"path"`
	Name         string `json:"name"`
	Server       string `json:"server"`
	Username     string `json:"username"`
	Groupname    string `json:"groupname"`
	ResourceType string `json:"resource_type"`
	WorkSession  string `json:"work_session,omitempty"`
}

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

type DownloadedFile struct {
	Path string
	Size int64
}

func DownloadFileToPath added in v1.6.0

func DownloadFileToPath(ac *client.AlpaconClient, serverName, remotePath, localPath, username, groupname, workSessionID string) (DownloadedFile, error)

type TransferErrorResponse added in v1.0.0

type TransferErrorResponse struct {
	Code string `json:"code"`
}

type TransferStatusResponse added in v1.0.0

type TransferStatusResponse struct {
	Success *bool  `json:"success"`
	Message string `json:"message"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL