Documentation ¶
Overview ¶
Package client provides the client interface for 'file'
Index ¶
- func ChangeRemoteFileGroup(ctx context.Context, conn *proxy.Conn, req ChgrpRequest) error
- func ChangeRemoteFileOwnership(ctx context.Context, conn *proxy.Conn, req ChownRequest) error
- func ChangeRemoteFilePermission(ctx context.Context, conn *proxy.Conn, path string, mode uint32) error
- func CopyRemoteFile(ctx context.Context, conn *proxy.Conn, source string, destination *FileConfig) error
- func MakeRemoteDir(ctx context.Context, conn *proxy.Conn, req MkdirRequest) error
- func ReadRemoteFile(ctx context.Context, conn *proxy.Conn, path string) ([]byte, error)
- func RemoveRemoteFile(ctx context.Context, conn *proxy.Conn, path string) error
- func SymlinkRemote(ctx context.Context, conn *proxy.Conn, target, linkname string) error
- func WriteRemoteFile(ctx context.Context, conn *proxy.Conn, config *FileConfig, contents []byte) error
- type ChgrpRequest
- type ChownRequest
- type FileConfig
- type ListRemoteResponse
- type ListRequest
- type MkdirRequest
- type ReadRemoteFileResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeRemoteFileGroup ¶ added in v1.23.6
ChangeRemoteFileGroup is a helper function for changing file group on one or more remote hosts using a proxy.Conn.
func ChangeRemoteFileOwnership ¶ added in v1.23.6
ChangeRemoteFileOwnership is a helper function for changing file ownership on one or more remote hosts using a proxy.Conn.
func ChangeRemoteFilePermission ¶ added in v1.23.6
func ChangeRemoteFilePermission(ctx context.Context, conn *proxy.Conn, path string, mode uint32) error
ChangeRemoteFilePermission is a helper function for changing file permission on one or more remote hosts using a proxy.Conn.
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 one or more remote hosts using a proxy.Conn.
func MakeRemoteDir ¶ added in v1.23.6
MakeRemoteDir is a helper function for creating a directory on one or more remote hosts using a proxy.Conn.
func ReadRemoteFile ¶
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
RemoveRemoteFile is a helper function for removing a file on one or more remote hosts using a proxy.Conn.
func SymlinkRemote ¶ added in v1.23.6
SymlinkRemote is a helper function for creating a symlink on one or more remote hosts using a proxy.Conn. This is similar to `ln -s <target> <linkname>`
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.
Types ¶
type ChgrpRequest ¶ added in v1.23.6
type ChownRequest ¶ added in v1.23.6
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.
type ListRemoteResponse ¶ added in v1.28.4
func ListRemote ¶ added in v1.28.4
func ListRemote(ctx context.Context, conn *proxy.Conn, listRequest ListRequest) ([]ListRemoteResponse, error)
ListRemote is a helper function for listing the contents of a directory on one or more remote hosts using a proxy.Conn. This is similar to `ls <path>`
type ListRequest ¶ added in v1.28.4
type MkdirRequest ¶ added in v1.23.6
type ReadRemoteFileResponse ¶ added in v1.23.6
func ReadRemoteFileMany ¶ added in v1.23.6
func ReadRemoteFileMany(ctx context.Context, conn *proxy.Conn, path string) ([]ReadRemoteFileResponse, error)
ReadRemoteFileMany is a helper function for reading a single file from one or more remote hosts using a proxy.Conn.