Help us shape the future of Go! Take the 2026 Go Developer Survey

scp

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package scp handles file uploads and downloads via scp command

Index

Constants

View Source
const (
	// OKByte is scp OK message bytes
	OKByte = 0x0
	// WarnByte tells that next goes a warning string
	WarnByte = 0x1
	// ErrByte tells that next goes an error string
	ErrByte = 0x2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Source      bool // data producer
	Sink        bool // data consumer
	Verbose     bool // verbose
	TargetIsDir bool // target should be dir
	Target      string
	Recursive   bool
	User        *user.User
	//Conn        ssh.ConnMetadata
	AuditLog events.IAuditLog

	// Ev:
	RemoteAddr string
	LocalAddr  string
}

Command mimics behavior of SCP command line tool to teleport can pretend it launches real scp behind the scenes

func (*Command) Execute added in v1.0.0

func (cmd *Command) Execute(ch io.ReadWriter) (err error)

Execute implements SSH file copy (SCP)

type MtimeCmd

type MtimeCmd struct {
	Mtime time.Time
	Atime time.Time
}

func ParseMtime

func ParseMtime(line string) (*MtimeCmd, error)

type NewFileCmd

type NewFileCmd struct {
	Mode   int64
	Length uint64
	Name   string
}

func ParseNewFile

func ParseNewFile(line string) (*NewFileCmd, error)

Jump to

Keyboard shortcuts

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