Documentation ¶
Overview ¶
Package ybdata locates directories the user has designated or conventionally uses for storing different types of data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶ added in v0.4.3
IsNotFound reports whether e indicates an HTTP 404 Not Found or 410 Gone response.
Types ¶
type Dirs ¶
type Dirs struct {
// contains filtered or unexported fields
}
Dirs is the result of locating directories.
func DirsFromEnv ¶
DirsFromEnv finds data directories based on environment variables.
func NewDirs ¶
NewDirs returns a set of directories that is enclosed within a root directory. This is useful for isolating test data.
func (*Dirs) BuildHome ¶ added in v0.4.3
BuildHome finds or creates a directory to store cached data for a target.
func (*Dirs) BuildHomeRoot ¶ added in v0.6.0
BuildHomeRoot finds the directory that contains the targets' home directories.
TODO(ch2755): This should get moved to a directory physically in the package directory.
func (*Dirs) Downloads ¶
Downloads returns the top-level directory to store downloaded files. This directory may not exist yet.
func (*Dirs) FindBuildHome ¶ added in v0.6.0
func (dirs *Dirs) FindBuildHome(packageDir, target string, desc *biome.Descriptor) string
FindBuildHome finds a directory to store cached data for a target.
type Downloader ¶ added in v0.6.0
type Downloader struct { // Client is the HTTP client to use to fetch URLs. // This can only be changed before the first call to Download. Client *http.Client // contains filtered or unexported fields }
Downloader manages a download cache.
func NewDownloader ¶ added in v0.6.0
func NewDownloader(dir string) *Downloader
NewDownloader returns a Downloader that maintains a cache in the given directory. The Downloader will create the directory if it does not exist.