ftp

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 14 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) 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 BulkDownloadRequest struct {
	Path      []string `json:"path"`
	Server    string   `json:"server"`
	Username  string   `json:"username"`
	Groupname string   `json:"groupname"`
}

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

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

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

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