scp

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2016 License: Apache-2.0 Imports: 12 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

func IsSCP

func IsSCP(cmd string) bool

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
}

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

func ParseCommand

func ParseCommand(arg, userName string) (*Command, error)

func (*Command) Execute added in v1.0.0

func (cmd *Command) Execute(ch io.ReadWriter) 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