client

package
v1.15.0 Latest Latest
Warning

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

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

Documentation

Overview

Package client provides the client interface for 'file'

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyRemoteFile

func CopyRemoteFile(ctx context.Context, conn *proxy.Conn, source string, destination *FileConfig) error

CopyRemoteFile is a helper function for copying a file on a remote host using a proxy.Conn. If the conn is defined for >1 targets this will return an error.

func ReadRemoteFile

func ReadRemoteFile(ctx context.Context, conn *proxy.Conn, path string) ([]byte, error)

ReadRemoteFile is a helper function for reading a single file from a remote host using a proxy.Conn. If the conn is defined for >1 targets this will return an error.

func RemoveRemoteFile added in v1.14.3

func RemoveRemoteFile(ctx context.Context, conn *proxy.Conn, path string) error

RemoveRemoteFile is a helper function for removing a file on a remote host using a proxy.Conn. If the conn is defined for >1 targets this will return an error.

func WriteRemoteFile

func WriteRemoteFile(ctx context.Context, conn *proxy.Conn, config *FileConfig, contents []byte) error

WriteRemoteFile is a helper function for writing a single file to a remote host using a proxy.Conn. If the conn is defined for >1 targets this will return an error.

Types

type FileConfig

type FileConfig struct {
	// Filename is the remote full path to write the file.
	Filename string

	// User is the remote user to chown() the file ownership.
	User string

	// Group is the remote group to chgrp() the file group.
	Group string

	// Perms are the standard unix file permissions for the remote file.
	Perms int

	// If overwrite is true the remote file will be overwritten if it exists,
	// otherwise it's an error to write to an existing file.
	Overwrite bool
}

FileConfig defines a configuration defining a remote file. This will be used when defining a remote written file such as writing a new file or copying one.

Jump to

Keyboard shortcuts

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