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 ¶
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 { Mkdir(path string, perm fs.FileMode) error MkdirAll(path string, perm fs.FileMode) error 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) WriteFile(name string, b []byte, mode fs.FileMode) error ReadDir(name string) ([]fs.DirEntry, error) Mknod(path string, mode uint32, dev int) error Readnod(name string) (dev int, err error) Symlink(oldname, newname string) error Link(oldname, newname string) error Readlink(name string) (target string, err error) Stat(path string) (fs.FileInfo, error) Lstat(path string) (fs.FileInfo, 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 GetXattr(path string, attr string) ([]byte, error) RemoveXattr(path string, attr string) error ListXattrs(path string) (map[string][]byte, error) }
FullFS is a filesystem that supports all filesystem operations.
func DirFS ¶
func DirFS(dir string, opts ...DirFSOption) FullFS
type OpenReaderAtFS ¶
type OpenReaderAtReadLinkFS ¶
type OpenReaderAtReadLinkFS interface { OpenReaderAtFS ReadLinkFS }
type OpenReaderAtReadLinkReadnodFS ¶
type OpenReaderAtReadLinkReadnodFS interface { OpenReaderAtFS ReadLinkFS ReadnodFS }