protocol

package
v0.0.0-...-390bab0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

协议: T: trans F: files TPackHead

Index

Constants

View Source
const (
	ConstMaxLength = 64 - 9

	PackheadSize   = constHeaderLength + constFlagLength
	PackSize       = constHeaderLength + constFlagLength + ConstMaxLength
	PackMd5sumSize = constHeaderLength + constMd5Length
)

Variables

View Source
var RecvFile string

Functions

func Accept

func Accept(listen net.Listener)

func Conn

func Conn(cmds []string, output io.Writer)

func CreateCfg

func CreateCfg() *readline.Config

func CreateNew

func CreateNew() *readline.Instance

func ExecShell

func ExecShell(l *readline.Instance, cmds []string, remote bool)

func ExecTryShell

func ExecTryShell(cmds []string) error

仅可使用非阻塞的shell命令

func Listen

func Listen()

func Pnt

func Pnt()

func Read

func Read(conn net.Conn, date []byte)

func Readline_process

func Readline_process(l *readline.Instance, remote bool)

func RecvAll

func RecvAll(conn net.Conn)

dispatcher 禁止创建协程 不回收资源

func RecvCmds

func RecvCmds(conn net.Conn, pack *TPack) (flag byte, size int64, path string)

func RecvRemote

func RecvRemote(conn net.Conn)

func RecvTarFile

func RecvTarFile(conn net.Conn) (flag bool)

func RecvTarback

func RecvTarback(conn net.Conn, recv []byte)

func Recvback

func Recvback(conn net.Conn) int

func Send

func Send(cmds []string, l *readline.Instance)

func SendBack

func SendBack(conn net.Conn) int

func SendHead

func SendHead(addr string, multi uint64, output io.Writer) (net.Conn, error)

func SendRemote

func SendRemote(addr string, output io.Writer)

func SendTar

func SendTar(wg *sync.WaitGroup, filesName string, conn net.Conn, pool *pb.Pool)

func Trans

func Trans(conn net.Conn, target string)

func Write

func Write(conn net.Conn, date []byte)

Types

type TMd5Pack

type TMd5Pack struct {
	// contains filtered or unexported fields
}

func NewTMd5Pack

func NewTMd5Pack() *TMd5Pack

func (*TMd5Pack) DepackMd5sum

func (buffer *TMd5Pack) DepackMd5sum() (flag byte, md5sum []byte)

func (*TMd5Pack) EnpackMd5sum

func (packet *TMd5Pack) EnpackMd5sum(head byte, md5sum []byte) []byte

type TPack

type TPack struct {
	// contains filtered or unexported fields
}

func NewTPack

func NewTPack() *TPack

func (*TPack) Depack

func (buffer *TPack) Depack() (head byte, flag int64, path string)

解包

func (*TPack) Enpack

func (packet *TPack) Enpack(head byte, flag int64, path string) (buf []byte)

封包

type TPackHead

type TPackHead struct {
	// contains filtered or unexported fields
}

func NewTPackHead

func NewTPackHead() *TPackHead

func (*TPackHead) DepackHead

func (buffer *TPackHead) DepackHead() (head byte, flag uint64)

func (*TPackHead) EnpackHead

func (packet *TPackHead) EnpackHead(head byte, flag uint64) []byte

func (*TPackHead) RecvHead

func (packet *TPackHead) RecvHead(conn net.Conn) (byte, int)

type TarGz

type TarGz struct {
	// contains filtered or unexported fields
}

func (*TarGz) SendTarback

func (myTar *TarGz) SendTarback(send []byte) bool

Jump to

Keyboard shortcuts

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