rs

package
v0.0.0-...-1285923 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UploadByte

func UploadByte(url string, b []byte) error

UploadByte ...

Types

type ClientConfig

type ClientConfig struct {
	Host     string //ip
	Port     int    // 端口
	Username string //用户名
	Password string //密码

	LastResult string //最近一次运行的结果
	SrcPath    string
	DstPath    string
	// contains filtered or unexported fields
}

ClientConfig 连接的配置

func (*ClientConfig) Download

func (cliConf *ClientConfig) Download(srcPath, dstPath string) error

Download ...

func (*ClientConfig) RunShell

func (cliConf *ClientConfig) RunShell(shell string) error

RunShell ...

func (*ClientConfig) Upload

func (cliConf *ClientConfig) Upload() error

Upload ...

type Filepackets

type Filepackets struct {
	UploadFileServerID string

	FileUploadURL string
	FileName      string
	SrcDir        string
	SrcFilePath   string
	Size          int64

	DstDir      string
	DstFilePath string

	UploadUser     string
	UploadPassword string

	PacketUploadURL string
	Packets         map[int]Packet
	PacketSize      int64
	PacketNum       int64

	UploadDoneURL string
}

Filepacket ...

func (*Filepackets) CreatePacket

func (c *Filepackets) CreatePacket(file *os.File, v Packet) error

CreatePacket ...

func (*Filepackets) UploadDone

func (c *Filepackets) UploadDone(status string) error

UploadDone ...

type Packet

type Packet struct {
	SortID     int
	Packetpath string
	Offset     int64
	Error      error
}

Packet ...

type RS

type RS struct {
	FileName       string
	SrcDir         string
	SrcFilePath    string
	DstDir         string
	DstFilePath    string
	Host           string
	Port           int
	UploadUser     string
	UploadPassword string
	FileCnki       bool
}

RS ...

func NewRS

func NewRS(host string, port int, user, password, sourcefile, distpath string) *RS

NewRS ...

func (*RS) FtpUpload

func (f *RS) FtpUpload() error

FtpUpload ...

func (*RS) NewSftp

func (rs *RS) NewSftp() (*ClientConfig, error)

NewSftp ...

func (*RS) ReadBigFile

func (c *RS) ReadBigFile() (*Filepackets, error)

ReadBigFile ...

Jump to

Keyboard shortcuts

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