Documentation
¶
Index ¶
- func CopyFile(dst WriteFS, dstFile string, src fs.FS, srcFile string) error
- func CopyTo(ctx context.Context, dst WriteFS, dstBasePath string, src fs.FS) error
- func TotalSize(ctx context.Context, fsys fs.FS) (uint64, error)
- func VisitFiles(ctx context.Context, fsys fs.FS, ...) error
- func WalkDir(fsys fs.FS, dir string, callback func(string, fs.DirEntry) error) error
- func WalkDirWithMatcher(fsys fs.FS, dir string, matcher *PatternMatcher, ...) error
- func WriteByteStream(ctx context.Context, fs WriteFS, path string, contents bytestream.ByteStream, ...) error
- func WriteFSToWorkspace(ctx context.Context, log io.Writer, vfs ReadWriteFS, src fs.FS) error
- func WriteFile(ctx context.Context, fs WriteFS, path string, contents []byte, ...) error
- func WriteFileExtended(ctx context.Context, dst ReadWriteFS, filePath string, mode fs.FileMode, ...) error
- func WriteWorkspaceFile(ctx context.Context, log io.Writer, vfs ReadWriteFS, filePath string, ...) error
- type ChmodFS
- type File
- type HasMatch
- type LocalFS
- type LocalOpt
- type Location
- type MatcherOpts
- type MkdirFS
- type PatternMatcher
- type ReadWriteFS
- type RmdirFS
- type TotalSizeFS
- type VisitFS
- type WriteFS
- type WriteFileExtendedOpts
- type WriteFileHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VisitFiles ¶
func VisitFiles(ctx context.Context, fsys fs.FS, visitor func(string, bytestream.ByteStream, fs.DirEntry) error) error
func WalkDirWithMatcher ¶
func WalkDirWithMatcher(fsys fs.FS, dir string, matcher *PatternMatcher, callback func(string, fs.DirEntry) error) error
func WriteByteStream ¶
func WriteByteStream(ctx context.Context, fs WriteFS, path string, contents bytestream.ByteStream, mode fs.FileMode) error
func WriteFSToWorkspace ¶
func WriteFSToWorkspace(ctx context.Context, log io.Writer, vfs ReadWriteFS, src fs.FS) error
func WriteFile ¶
func WriteFile(ctx context.Context, fs WriteFS, path string, contents []byte, mode fs.FileMode) error
func WriteFileExtended ¶
func WriteFileExtended(ctx context.Context, dst ReadWriteFS, filePath string, mode fs.FileMode, opts WriteFileExtendedOpts, writeContents func(io.Writer) error) error
func WriteWorkspaceFile ¶
func WriteWorkspaceFile(ctx context.Context, log io.Writer, vfs ReadWriteFS, filePath string, h func(io.Writer) error) error
Types ¶
type LocalFS ¶
type LocalFS interface {
fs.ReadDirFS
WriteFS
MkdirFS
}
func ReadWriteLocalFS ¶
func ReadWriteLocalFS(path string, opts ...LocalOpt) LocalFS
type LocalOpt ¶
type LocalOpt interface {
// contains filtered or unexported methods
}
func AnnounceWrites ¶
func AnnounceWrites(to io.Writer) LocalOpt
type Location ¶
type Location struct {
ModuleName string
// FS rooted at the module [ModuleName] root.
FS fs.FS
// Path within the module (within [FS]).
RelPath string
}
Identifies a package/file within a module.
func ResolveLocation ¶
func ResolveLocation(moduleName, packageName string) (Location, bool)
func (Location) AsPackageName ¶
func (loc Location) AsPackageName() schema.PackageName
func (Location) ErrorLocation ¶
func (loc Location) ErrorLocation() string
Implements the fnerrors.Location interface.
type MatcherOpts ¶
type MatcherOpts struct {
IncludeFiles []string
IncludeFilesGlobs []string
ExcludeFilesGlobs []string
}
type PatternMatcher ¶
type PatternMatcher struct {
// contains filtered or unexported fields
}
func NewMatcher ¶
func NewMatcher(opts MatcherOpts) (*PatternMatcher, error)
type ReadWriteFS ¶
type ReadWriteFS interface {
fs.ReadDirFS
WriteFS
}
type TotalSizeFS ¶
type TotalSizeFS interface {
TotalSize(ctx context.Context) (uint64, error)
}
type VisitFS ¶
type VisitFS interface {
VisitFiles(context.Context, func(string, bytestream.ByteStream, fs.DirEntry) error) error
}
type WriteFS ¶
type WriteFS interface {
OpenWrite(path string, mode fs.FileMode) (WriteFileHandle, error)
Remove(path string) error
}
type WriteFileExtendedOpts ¶
type WriteFileExtendedOpts struct {
ContentsDigest schema.Digest
CompareContents bool
FailOverwrite bool
EnsureFileMode bool
AnnounceWrite io.Writer
}
type WriteFileHandle ¶
type WriteFileHandle interface {
io.WriteCloser
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.