Documentation ¶
Index ¶
- Variables
- func Chdir(dir string) (string, error)
- func GetBundleURL(accountURL string, contentID types.ContentID, bundleID types.BundleID) string
- func GetDashboardURL(accountURL string, contentID types.ContentID) string
- func GetDirectURL(accountURL string, contentID types.ContentID) string
- func GetListOfPossibleURLs(accountURL string) ([]string, error)
- func GetLogsURL(accountURL string, contentID types.ContentID) string
- func GetRequestBody(req *http.Request) ([]byte, error)
- func IsPythonEnvironmentDir(path AbsolutePath) bool
- func IsRenvLibraryDir(path AbsolutePath) bool
- func Map[T any](fn func(T) T, list []T) []T
- func NewMockPathLooker() *mockPathLooker
- func NewSymlinkWalker(walker Walker, log logging.Logger) *symlinkWalker
- func NormalizeServerURL(serverURL string) (string, error)
- func RandomBytes(n int) ([]byte, error)
- func RandomString(n int) (string, error)
- func ReadTOMLFile(path AbsolutePath, dest any) error
- func RemoveDuplicates[T comparable](list []T) []T
- func URLJoin(a, b string) string
- func ValidateFilename(name string) error
- type AbsolutePath
- func (p AbsolutePath) Abs() (AbsolutePath, error)
- func (p AbsolutePath) Clean() AbsolutePath
- func (p AbsolutePath) Dir() AbsolutePath
- func (p AbsolutePath) Glob(pattern string) ([]AbsolutePath, error)
- func (p AbsolutePath) Join(other ...string) AbsolutePath
- func (p AbsolutePath) SafeJoin(other ...string) (AbsolutePath, error)
- func (p AbsolutePath) Split() (AbsolutePath, string)
- func (p AbsolutePath) Walk(fn AbsoluteWalkFunc) error
- func (p AbsolutePath) WithFs(fs afero.Fs) AbsolutePath
- func (p AbsolutePath) WithoutExt() AbsolutePath
- type AbsoluteWalkFunc
- type DecodeError
- type FSWalker
- type FilteredFS
- func (fs *FilteredFS) Chmod(name string, mode os.FileMode) error
- func (fs *FilteredFS) Chown(name string, uid, gid int) error
- func (fs *FilteredFS) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (fs *FilteredFS) Create(name string) (afero.File, error)
- func (fs *FilteredFS) Mkdir(name string, perm os.FileMode) error
- func (fs *FilteredFS) MkdirAll(path string, perm os.FileMode) error
- func (fs *FilteredFS) Name() string
- func (fs *FilteredFS) Open(name string) (afero.File, error)
- func (fs *FilteredFS) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (fs *FilteredFS) Remove(name string) error
- func (fs *FilteredFS) RemoveAll(path string) error
- func (fs *FilteredFS) Rename(oldname, newname string) error
- func (fs *FilteredFS) Stat(name string) (os.FileInfo, error)
- type Nothing
- type Path
- func (p Path) Abs() (AbsolutePath, error)
- func (p Path) Base() string
- func (p Path) Chmod(mode os.FileMode) error
- func (p Path) Chown(uid int, gid int) error
- func (p Path) Chtimes(atime, mtime time.Time) error
- func (p Path) Clean() Path
- func (p Path) Create() (afero.File, error)
- func (p Path) Dir() Path
- func (p Path) DirExists() (bool, error)
- func (p Path) Exists() (bool, error)
- func (p Path) Ext() string
- func (p Path) Fs() afero.Fs
- func (p Path) Glob(pattern string) ([]Path, error)
- func (p Path) HasSuffix(suffix string) bool
- func (p Path) IsAbs() bool
- func (p Path) IsDir() (bool, error)
- func (p Path) IsEmpty() (bool, error)
- func (p Path) IsLocal() bool
- func (p Path) Join(other ...string) Path
- func (p Path) LstatIfPossible() (fs.FileInfo, bool, error)
- func (p Path) MarshalJSON() ([]byte, error)
- func (p Path) Match(pattern string) (matched bool, err error)
- func (p Path) Mkdir(perm os.FileMode) error
- func (p Path) MkdirAll(perm os.FileMode) error
- func (p Path) Open() (afero.File, error)
- func (p Path) OpenFile(flag int, perm os.FileMode) (afero.File, error)
- func (p Path) ReadDir() ([]os.FileInfo, error)
- func (p Path) ReadDirNames() ([]string, error)
- func (p Path) ReadFile() ([]byte, error)
- func (p Path) ReadlinkIfPossible() (Path, error)
- func (p Path) Rel(basepath AbsolutePath) (RelativePath, error)
- func (p Path) Remove() error
- func (p Path) RemoveAll() error
- func (p Path) Rename(newPath Path) error
- func (p Path) RenameStr(newName string) error
- func (p Path) SafeJoin(other ...string) (Path, error)
- func (p Path) Split() (Path, string)
- func (p Path) SplitList() []string
- func (p Path) Stat() (os.FileInfo, error)
- func (p Path) String() string
- func (p Path) SymlinkIfPossible(target Path) error
- func (p Path) TempDir(prefix string) (Path, error)
- func (p Path) TempFile(pattern string) (afero.File, error)
- func (p Path) ToSlash() string
- func (p *Path) UnmarshalJSON(data []byte) error
- func (p *Path) UnmarshalText(data []byte) error
- func (p Path) VolumeName(path string) string
- func (p Path) Walk(fn WalkFunc) error
- func (p Path) WithFs(fs afero.Fs) Path
- func (p Path) WithoutExt() Path
- func (p Path) WriteFile(data []byte, perm os.FileMode) error
- func (p Path) WriteReader(r io.Reader) error
- type PathLooker
- type RelativePath
- func (p RelativePath) Clean() RelativePath
- func (p RelativePath) Dir() RelativePath
- func (p RelativePath) Glob(pattern string) ([]RelativePath, error)
- func (p RelativePath) Join(other ...string) RelativePath
- func (p RelativePath) Rel(basepath AbsolutePath) (RelativePath, error)
- func (p RelativePath) SafeJoin(other ...string) (RelativePath, error)
- func (p RelativePath) Split() (RelativePath, string)
- func (p RelativePath) Walk(fn RelativeWalkFunc) error
- func (p RelativePath) WithFs(fs afero.Fs) RelativePath
- func (p RelativePath) WithoutExt() RelativePath
- type RelativeWalkFunc
- type TarWriter
- type WalkFunc
- type Walker
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidName = errors.New("invalid name: cannot be empty or '.', or contain '..' or any of these characters: " + badChars)
View Source
var KnownSiteYmlConfigFiles = []string{"_site.yml", "_site.yaml", "_bookdown.yml", "_bookdown.yaml"}
Functions ¶
func GetBundleURL ¶ added in v1.1.7
func GetDashboardURL ¶ added in v1.1.7
func GetDirectURL ¶ added in v1.1.7
func GetListOfPossibleURLs ¶ added in v1.2.0
func GetLogsURL ¶ added in v1.1.7
func GetRequestBody ¶
GetRequestBody reads the body of an http client request. It returns the body and makes req.Body ready to read again.
func IsPythonEnvironmentDir ¶
func IsPythonEnvironmentDir(path AbsolutePath) bool
func IsRenvLibraryDir ¶
func IsRenvLibraryDir(path AbsolutePath) bool
func NewMockPathLooker ¶
func NewMockPathLooker() *mockPathLooker
func NewSymlinkWalker ¶
NewSymlinkWalker creates a SymlinkWalker, an instance of the Walker interface that resolves symlinks before passing info to the callback function.
func NormalizeServerURL ¶
func RandomBytes ¶
func RandomString ¶
func ReadTOMLFile ¶
func ReadTOMLFile(path AbsolutePath, dest any) error
func RemoveDuplicates ¶
func RemoveDuplicates[T comparable](list []T) []T
func ValidateFilename ¶
Types ¶
type AbsolutePath ¶
type AbsolutePath struct {
Path
}
func NewAbsolutePath ¶
func NewAbsolutePath(path string, fs afero.Fs) AbsolutePath
func UserHomeDir ¶
func UserHomeDir(fs afero.Fs) (AbsolutePath, error)
func (AbsolutePath) Abs ¶
func (p AbsolutePath) Abs() (AbsolutePath, error)
func (AbsolutePath) Clean ¶
func (p AbsolutePath) Clean() AbsolutePath
func (AbsolutePath) Dir ¶
func (p AbsolutePath) Dir() AbsolutePath
func (AbsolutePath) Glob ¶
func (p AbsolutePath) Glob(pattern string) ([]AbsolutePath, error)
func (AbsolutePath) Join ¶
func (p AbsolutePath) Join(other ...string) AbsolutePath
func (AbsolutePath) SafeJoin ¶
func (p AbsolutePath) SafeJoin(other ...string) (AbsolutePath, error)
func (AbsolutePath) Split ¶
func (p AbsolutePath) Split() (AbsolutePath, string)
func (AbsolutePath) Walk ¶
func (p AbsolutePath) Walk(fn AbsoluteWalkFunc) error
func (AbsolutePath) WithFs ¶
func (p AbsolutePath) WithFs(fs afero.Fs) AbsolutePath
func (AbsolutePath) WithoutExt ¶ added in v1.1.6
func (p AbsolutePath) WithoutExt() AbsolutePath
type AbsoluteWalkFunc ¶
type AbsoluteWalkFunc func(path AbsolutePath, info fs.FileInfo, err error) error
type DecodeError ¶
type DecodeError struct { File string `mapstructure:"file"` Line int `mapstructure:"line"` Column int `mapstructure:"column"` Key string `mapstructure:"key"` Problem string `mapstructure:"problem"` }
DecodeError mirrors toml.DecodeError, with exported fields
func (*DecodeError) Error ¶
func (e *DecodeError) Error() string
type FSWalker ¶
type FSWalker struct{}
func (FSWalker) Walk ¶
func (w FSWalker) Walk(root AbsolutePath, fn AbsoluteWalkFunc) error
type FilteredFS ¶
type FilteredFS struct {
// contains filtered or unexported fields
}
func NewFilteredFS ¶
func NewFilteredFS(base afero.Fs, paths []string) *FilteredFS
func (*FilteredFS) Name ¶
func (fs *FilteredFS) Name() string
func (*FilteredFS) Remove ¶
func (fs *FilteredFS) Remove(name string) error
func (*FilteredFS) RemoveAll ¶
func (fs *FilteredFS) RemoveAll(path string) error
func (*FilteredFS) Rename ¶
func (fs *FilteredFS) Rename(oldname, newname string) error
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func DirFromPath ¶
DirFromPath returns the directory associated with the specified path. If the path is a directory, it is returned. Otherwise, the parent dir of the path is returned.
func (Path) Abs ¶
func (p Path) Abs() (AbsolutePath, error)
func (Path) MarshalJSON ¶
func (Path) ReadDirNames ¶ added in v1.1.6
func (Path) ReadlinkIfPossible ¶
func (Path) Rel ¶
func (p Path) Rel(basepath AbsolutePath) (RelativePath, error)
func (Path) SymlinkIfPossible ¶
func (*Path) UnmarshalJSON ¶
func (*Path) UnmarshalText ¶
func (Path) VolumeName ¶
func (Path) WithoutExt ¶ added in v1.1.6
type PathLooker ¶
func NewPathLooker ¶
func NewPathLooker() PathLooker
type RelativePath ¶
type RelativePath struct {
Path
}
func NewRelativePath ¶
func NewRelativePath(path string, fs afero.Fs) RelativePath
func (RelativePath) Clean ¶
func (p RelativePath) Clean() RelativePath
func (RelativePath) Dir ¶
func (p RelativePath) Dir() RelativePath
func (RelativePath) Glob ¶
func (p RelativePath) Glob(pattern string) ([]RelativePath, error)
func (RelativePath) Join ¶
func (p RelativePath) Join(other ...string) RelativePath
func (RelativePath) Rel ¶
func (p RelativePath) Rel(basepath AbsolutePath) (RelativePath, error)
func (RelativePath) SafeJoin ¶
func (p RelativePath) SafeJoin(other ...string) (RelativePath, error)
func (RelativePath) Split ¶
func (p RelativePath) Split() (RelativePath, string)
func (RelativePath) Walk ¶
func (p RelativePath) Walk(fn RelativeWalkFunc) error
func (RelativePath) WithFs ¶
func (p RelativePath) WithFs(fs afero.Fs) RelativePath
func (RelativePath) WithoutExt ¶ added in v1.1.6
func (p RelativePath) WithoutExt() RelativePath
type RelativeWalkFunc ¶
type RelativeWalkFunc func(path RelativePath, info fs.FileInfo, err error) error
type Walker ¶
type Walker interface {
Walk(root AbsolutePath, fn AbsoluteWalkFunc) error
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.