Documentation
¶
Overview ¶
Copyright 2023 Chainguard, Inc.
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 ¶
- type APKFS
- type APKFSType
- type DirFSOption
- type File
- type FullFS
- type OpenReaderAtFS
- type OpenReaderAtReadLinkFS
- type OpenReaderAtReadLinkReadnodFS
- type ReadLinkFS
- type ReaderFS
- type ReadnodFS
- type SubFS
- func (s *SubFS) Chmod(path string, perm fs.FileMode) error
- func (s *SubFS) Chown(path string, uid int, gid int) error
- func (s *SubFS) Chtimes(path string, atime time.Time, mtime time.Time) error
- func (s *SubFS) Create(name string) (File, error)
- func (s *SubFS) GetXattr(path string, attr string) ([]byte, error)
- func (s *SubFS) Link(oldname, newname string) error
- func (s *SubFS) ListXattrs(path string) (map[string][]byte, error)
- func (s *SubFS) Lstat(path string) (fs.FileInfo, error)
- func (s *SubFS) Mkdir(path string, perm fs.FileMode) error
- func (s *SubFS) MkdirAll(path string, perm fs.FileMode) error
- func (s *SubFS) Mknod(path string, mode uint32, dev int) error
- func (s *SubFS) Open(path string) (fs.File, error)
- func (s *SubFS) OpenFile(name string, flag int, perm fs.FileMode) (File, error)
- func (s *SubFS) OpenReaderAt(path string) (File, error)
- func (s *SubFS) ReadDir(name string) ([]fs.DirEntry, error)
- func (s *SubFS) ReadFile(name string) ([]byte, error)
- func (s *SubFS) Readlink(name string) (string, error)
- func (s *SubFS) Readnod(path string) (int, error)
- func (s *SubFS) Remove(name string) error
- func (s *SubFS) RemoveXattr(path string, attr string) error
- func (s *SubFS) SetXattr(path string, attr string, data []byte) error
- func (s *SubFS) Stat(path string) (fs.FileInfo, error)
- func (s *SubFS) Sub(path string) (FullFS, error)
- func (s *SubFS) Symlink(oldname, newname string) error
- func (s *SubFS) WriteFile(name string, b []byte, mode fs.FileMode) error
- type XattrFS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirFSOption ¶
type DirFSOption func(*dirFSOpts) error
DirFSOption is an option for DirFS
func DirFSWithCaseSensitive ¶
func DirFSWithCaseSensitive(caseSensitive bool) DirFSOption
DirFSWithCaseSensitive allows you to specify whether the underlying filesystem should be treated as case-sensitive or insensitive. If you do not specify this, it determines it by testing the underlying filesystem. Normally you should let the filesystem determine this, but sometimes this can be useful.
func WithCreateDir ¶
func WithCreateDir() DirFSOption
WithCreateDir allows you to specify whether the underlying directory should be created if it does not exist. Default is false.
type File ¶
File is an interface for a file. It includes Read, Write, Close. This wouldn't be necessary if os.File were an interface, or if fs.File were read/write.
type FullFS ¶
type FullFS interface {
ReaderFS
Mkdir(path string, perm fs.FileMode) error
MkdirAll(path string, perm fs.FileMode) error
WriteFile(name string, b []byte, mode fs.FileMode) error
Mknod(path string, mode uint32, dev int) error
Symlink(oldname, newname string) error
Link(oldname, newname string) error
Create(name string) (File, error)
Remove(name string) error
Chmod(path string, perm fs.FileMode) error
Chown(path string, uid int, gid int) error
Chtimes(path string, atime time.Time, mtime time.Time) error
SetXattr(path string, attr string, data []byte) error
RemoveXattr(path string, attr string) error
Sub(path string) (FullFS, error)
}
FullFS is a filesystem that supports all filesystem operations.
type OpenReaderAtFS ¶
type OpenReaderAtReadLinkFS ¶
type OpenReaderAtReadLinkFS interface {
OpenReaderAtFS
ReadLinkFS
}
type OpenReaderAtReadLinkReadnodFS ¶
type OpenReaderAtReadLinkReadnodFS interface {
OpenReaderAtFS
ReadLinkFS
ReadnodFS
}
type ReaderFS ¶ added in v1.0.0
type ReaderFS interface {
Open(name string) (fs.File, error)
OpenReaderAt(name string) (File, error)
OpenFile(name string, flag int, perm fs.FileMode) (File, error)
ReadFile(name string) ([]byte, error)
ReadDir(name string) ([]fs.DirEntry, error)
Readnod(name string) (dev int, err error)
Readlink(name string) (target string, err error)
Stat(path string) (fs.FileInfo, error)
Lstat(path string) (fs.FileInfo, error)
GetXattr(path string, attr string) ([]byte, error)
ListXattrs(path string) (map[string][]byte, error)
}
ReaderFS is a filesystem that supports read-only operations.