Documentation
¶
Index ¶
- Variables
- func Chdir(dir string) (string, error)
- func DiscoverServerURL(providedURL string, tester URLTester) (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 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 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 ExistsFunc
- type FSWalker
- 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 URLTester
- 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 DiscoverServerURL ¶ added in v1.25.0
DiscoverServerURL attempts to find the correct server URL by testing a list of possible URLs derived from the provided URL. It walks the possible URL list backwards, prioritizing the full URL with all path segments over the URL with all path segments removed. Returns the first URL that passes the test, or the original URL if none pass.
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 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 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 ExistsFunc ¶ added in v1.10.0
type FSWalker ¶
type FSWalker struct{}
func (FSWalker) Walk ¶
func (w FSWalker) Walk(root AbsolutePath, fn AbsoluteWalkFunc) error
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
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 URLTester ¶ added in v1.25.0
URLTester is a function type that tests if a URL is valid/accessible Returns nil if the URL is valid, or an error if not
type Walker ¶
type Walker interface {
Walk(root AbsolutePath, fn AbsoluteWalkFunc) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.