goftp

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: BSD-4-Clause Imports: 9 Imported by: 0

README

FTP SFTP Client

Getting started

To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Already a pro? Just edit this README.md and make it your own. Want to make it easy? Use the template at the bottom!

Add your files

cd existing_repo
git remote add origin https://gitlab.com/circutor/firmware/FTP-SFTP_Client.git
git branch -M main
git push -uf origin main

Integrate with your tools

Collaborate with your team

Test and Deploy

Use the built-in continuous integration in GitLab.


Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFtpLogin   = errors.New("wrong username or password")
	ErrFtpService = errors.New("service unavailable")
	ErrFtpLink    = errors.New("link failed")
)

Functions

This section is empty.

Types

type FtpClient

type FtpClient struct{}

func NewFtpClient

func NewFtpClient() *FtpClient

NewFtpClient creates a new FTP client.

func (*FtpClient) Receive

func (fc *FtpClient) Receive(host string, port string, timeout time.Duration, user string, password string, fileName string) ([]byte, error)

Receive obtains a file from the FTP server.

func (*FtpClient) Send

func (fc *FtpClient) Send(host string, port string, timeout time.Duration, user string, password string, data []byte, fileName string) error

Send sends a file to the FTP server.

type SftpClient

type SftpClient struct{}

func NewSftpClient

func NewSftpClient() *SftpClient

NewClient creates a new SFTP client.

func (*SftpClient) Receive added in v1.1.0

func (fc *SftpClient) Receive(host string, port string, timeout time.Duration, user string, password string, fileName string) ([]byte, error)

Receive downloads a file from the SFTP server.

func (*SftpClient) Send

func (fc *SftpClient) Send(host string, port string, timeout time.Duration, user string, password string, data []byte, fileName string) error

Send sends a file to the SFTP server.

Directories

Path Synopsis
examples
ftp

Jump to

Keyboard shortcuts

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