aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/kr/fs/filesystem.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-10 08:57:58 +0000
committerGitHub <noreply@github.com>2022-08-10 08:57:58 +0000
commit84502fc1447867aba66ea6725e22bb57cddce42c (patch)
tree8fe47161286ee1bc7f677852799648cf3f7a5116 /vendor/github.com/kr/fs/filesystem.go
parentc1eb9f65ac67d72f557e3770975b227657d31d4b (diff)
parent280f5d8cb01d115618d5ef131c718496a3b4900e (diff)
downloadpodman-84502fc1447867aba66ea6725e22bb57cddce42c.tar.gz
podman-84502fc1447867aba66ea6725e22bb57cddce42c.tar.bz2
podman-84502fc1447867aba66ea6725e22bb57cddce42c.zip
Merge pull request #15094 from cdoern/ssh
podman ssh work, using new c/common interface
Diffstat (limited to 'vendor/github.com/kr/fs/filesystem.go')
-rw-r--r--vendor/github.com/kr/fs/filesystem.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/github.com/kr/fs/filesystem.go b/vendor/github.com/kr/fs/filesystem.go
new file mode 100644
index 000000000..f1c4805fb
--- /dev/null
+++ b/vendor/github.com/kr/fs/filesystem.go
@@ -0,0 +1,36 @@
+package fs
+
+import (
+ "io/ioutil"
+ "os"
+ "path/filepath"
+)
+
+// FileSystem defines the methods of an abstract filesystem.
+type FileSystem interface {
+
+ // ReadDir reads the directory named by dirname and returns a
+ // list of directory entries.
+ ReadDir(dirname string) ([]os.FileInfo, error)
+
+ // Lstat returns a FileInfo describing the named file. If the file is a
+ // symbolic link, the returned FileInfo describes the symbolic link. Lstat
+ // makes no attempt to follow the link.
+ Lstat(name string) (os.FileInfo, error)
+
+ // Join joins any number of path elements into a single path, adding a
+ // separator if necessary. The result is Cleaned; in particular, all
+ // empty strings are ignored.
+ //
+ // The separator is FileSystem specific.
+ Join(elem ...string) string
+}
+
+// fs represents a FileSystem provided by the os package.
+type fs struct{}
+
+func (f *fs) ReadDir(dirname string) ([]os.FileInfo, error) { return ioutil.ReadDir(dirname) }
+
+func (f *fs) Lstat(name string) (os.FileInfo, error) { return os.Lstat(name) }
+
+func (f *fs) Join(elem ...string) string { return filepath.Join(elem...) }