ftp

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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. 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 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