Documentation ¶
Index ¶
- Constants
- func FileExists(filePath string) bool
- func IsSameFileSize(targetFile string, compareFile fs.FileInfo) (bool, error)
- func ReadMetadata(folderPath, filename string) (map[string]FileMetadata, error)
- func WriteMetadata(filePath, filename string, size uint64, status FileTransferStatus) error
- type ConnectionInfo
- type ErrorResponse
- type File
- type FileListResponse
- type FileMetadata
- type FileTransferStatus
- type SFTPClient
- type SynologyClient
Constants ¶
View Source
const ( Init = FileTransferStatus("INIT") NotSent = FileTransferStatus("NOT_SENT") Sent = FileTransferStatus("SENT") Failed = FileTransferStatus("FAILED") )
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func ReadMetadata ¶
func ReadMetadata(folderPath, filename string) (map[string]FileMetadata, error)
func WriteMetadata ¶
func WriteMetadata(filePath, filename string, size uint64, status FileTransferStatus) error
Types ¶
type ConnectionInfo ¶
type ErrorResponse ¶
type File ¶
type File struct { Name string `json:"name"` Path string `json:"path"` IsDir bool `json:"isdir"` Additional struct { Size uint64 `json:"size"` } `json:"additional"` List *FileListResponse }
type FileListResponse ¶
type FileMetadata ¶
type FileTransferStatus ¶
type FileTransferStatus string
type SFTPClient ¶
type SFTPClient struct { ConnInfo *ConnectionInfo Client *sftp.Client }
func NewSFTPClient ¶
func NewSFTPClient(info *ConnectionInfo) (*SFTPClient, error)
func (*SFTPClient) Close ¶
func (sc *SFTPClient) Close() error
func (*SFTPClient) RemoveFile ¶
func (sc *SFTPClient) RemoveFile(targetFilePath string) error
type SynologyClient ¶
type SynologyClient struct { ConnInfo *ConnectionInfo SessID string }
func NewSynologyClient ¶
func NewSynologyClient(info *ConnectionInfo) (*SynologyClient, error)
func (*SynologyClient) DownloadFile ¶
func (client *SynologyClient) DownloadFile(filePath, destPath string) (string, int64, error)
func (*SynologyClient) GetFileList ¶
func (client *SynologyClient) GetFileList(folderPath string) (*FileListResponse, error)
Click to show internal directories.
Click to hide internal directories.