Documentation ¶
Overview ¶
Copyright ©2015 The Go Authors Copyright ©2015 Steve Francia <spf@spf13.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File interface { io.Closer io.Reader io.ReaderAt io.Seeker io.Writer io.WriterAt Name() string Readdir(count int) ([]os.FileInfo, error) Readdirnames(n int) ([]string, error) Stat() (os.FileInfo, error) Sync() error Truncate(size int64) error WriteString(s string) (ret int, err error) }
File represents a file in the filesystem.
type Fs ¶
type Fs interface { // Create creates a file in the filesystem, returning the file and an // error, if any happens. Create(name string) (File, error) // Mkdir creates a directory in the filesystem, return an error if any // happens. Mkdir(name string, perm os.FileMode) error // MkdirAll creates a directory path and all parents that does not exist // yet. MkdirAll(path string, perm os.FileMode) error // Open opens a file, returning it or an error, if any happens. Open(name string) (File, error) // OpenFile opens a file using the given flags and the given mode. OpenFile(name string, flag int, perm os.FileMode) (File, error) // Remove removes a file identified by name, returning an error, if any // happens. Remove(name string) error // RemoveAll removes a directory path and any children it contains. It // does not fail if the path does not exist (return nil). RemoveAll(path string) error // Rename renames a file. Rename(oldname, newname string) error // Stat returns a FileInfo describing the named file, or an error, if any // happens. Stat(name string) (os.FileInfo, error) // The name of this FileSystem Name() string //Chmod changes the mode of the named file to mode. Chmod(name string, mode os.FileMode) error //Chtimes changes the access and modification times of the named file Chtimes(name string, atime time.Time, mtime time.Time) error }
Fs is the filesystem interface.
Any simulated or real filesystem should implement this interface.