Documentation ¶
Index ¶
- Constants
- func ChangeFileName(f *FileData, newname string)
- func New(client *middleware.Client) afero.Fs
- func SetModTime(f *FileData, mtime time.Time)
- func SetMode(f *FileData, mode os.FileMode)
- type Dir
- type DirMap
- type File
- func (f *File) Close() error
- func (f File) Data() *FileData
- func (f *File) Info() *FileInfo
- func (f *File) Name() string
- func (f *File) Read(b []byte) (n int, err error)
- func (f *File) ReadAt(b []byte, off int64) (n int, err error)
- func (f *File) Readdir(count int) (res []os.FileInfo, err error)
- func (f *File) Readdirnames(n int) (names []string, err error)
- func (f *File) Seek(offset int64, whence int) (int64, error)
- func (f *File) Stat() (os.FileInfo, error)
- func (f *File) Sync() error
- func (f *File) Truncate(size int64) error
- func (f *File) Write(b []byte) (n int, err error)
- func (f *File) WriteAt(b []byte, off int64) (n int, err error)
- func (f *File) WriteString(s string) (ret int, err error)
- type FileData
- type FileInfo
- type Fs
- func (s Fs) Chmod(name string, mode os.FileMode) error
- func (s Fs) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (s Fs) Create(name string) (afero.File, error)
- func (s Fs) Lstat(p string) (os.FileInfo, error)
- func (s Fs) Mkdir(name string, perm os.FileMode) error
- func (s Fs) MkdirAll(path string, perm os.FileMode) error
- func (s Fs) Name() string
- func (s Fs) Open(name string) (afero.File, error)
- func (s Fs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (s Fs) Remove(name string) error
- func (s Fs) RemoveAll(path string) error
- func (s Fs) Rename(oldname, newname string) error
- func (s Fs) Stat(name string) (os.FileInfo, error)
Constants ¶
const FilePathSeparator = string(filepath.Separator)
Variables ¶
This section is empty.
Functions ¶
func ChangeFileName ¶
func SetModTime ¶
Types ¶
type Dir ¶
type Dir interface { Find(name string) (*FileData, bool) Len() int Names() []string Files() []*FileData Add(*FileData) Remove(*FileData) }
Interface of a Directory Manager
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) Read ¶
Read reads up to len(b) bytes from the File. It returns the number of bytes read and any error encountered. At end of file, Read returns 0, io.EOF.
func (*File) Sync ¶
Sync commits the current contents of the file to stable storage. Typically, this means flushing the file system's in-memory copy of recently written data to disk.
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs is an afero.Fs implementation that abstracts Tromos as a filesystem service to the end-user. The filesystem maintains in memory only the cached files
func (Fs) Create ¶
Create creates or truncates the named file. If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError.
func (Fs) Open ¶
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
func (Fs) OpenFile ¶
OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.). If the file does not exist, and the O_CREATE flag is passed, it is created with mode perm (before umask). If successful, methods on the returned File can be used for I/O. If there is an error, it will be of type *PathError.