Documentation ¶
Overview ¶
Package scp implements SSH scp storager and abstract file manager
Index ¶
- Constants
- func InfoToCreateCmd(info os.FileInfo) string
- func InfoToTimestampCmd(info os.FileInfo) string
- func New(options ...storage.Option) storage.Manager
- func NewInfo(createResponse string, modified *time.Time) (os.FileInfo, error)
- func NewStorager(address string, timeout time.Duration, config *ssh.ClientConfig) (storage.Storager, error)
- func ParseTimeResponse(response string) (*time.Time, error)
- func Provider(options ...storage.Option) (storage.Manager, error)
- type AuthProvider
- type KeyAuth
Constants ¶
View Source
const ( //FileToken crate file token FileToken = 'C' //DirToken create directory token DirToken = 'D' //TimestampToken timestamp token TimestampToken = 'T' //EndDirToken end of dir token EndDirToken = 'E' //WarningToken warning token WarningToken = 0x1 //ErrorToken error token ErrorToken = 0x2 //DefaultPort default SSH port DefaultPort = 22 )
View Source
const (
DefaultFileMode os.FileMode = 0755
)
View Source
const Scheme = "scp"
Scheme defines scp URL scheme
Variables ¶
This section is empty.
Functions ¶
func InfoToCreateCmd ¶
InfoToCreateCmd returns scp create command for supplied info
func InfoToTimestampCmd ¶
InfoToTimestampCmd returns scp timestamp command for supplied info
func NewStorager ¶
func NewStorager(address string, timeout time.Duration, config *ssh.ClientConfig) (storage.Storager, error)
NewStorager returns a new storager
func ParseTimeResponse ¶
ParseTimeResponse parases respons time
Types ¶
type AuthProvider ¶
type AuthProvider interface {
ClientConfig() (*ssh.ClientConfig, error)
}
AuthProvider represents ssh client config authProvider
func NewAuthProvider ¶
func NewAuthProvider(pemAuth KeyAuth, credAuth option.BasicAuth) AuthProvider
NewAuthProvider returns new auth provider
type KeyAuth ¶
type KeyAuth interface { //Singer returns signer key Singer() (ssh.Signer, error) Username() string }
KeyAuth represents a key based auth
func LocalhostKeyAuth ¶
LocalhostKeyAuth returns a localhost key authenticator with ~/.ssh/authorized_keys
func NewKeyAuth ¶
NewKeyAuth returns a new private key authenticator
Click to show internal directories.
Click to hide internal directories.