Documentation
¶
Index ¶
- func FileNameMin(filename string) string
- type File
- type FileType
- type Files
- type Include
- type Includes
- type Package
- func (p *Package) Assets(assetsDir string, filePath string) (Files, string, error)
- func (p *Package) AssetsAt(rootDir, assetsDir, filePath string) (Files, string, error)
- func (p *Package) AssetsDir(assets string) string
- func (p *Package) CacheDir(cacheDir string) string
- func (p *Package) CacheFiles(rootDir, cacheDir string) (Files, error)
- func (p *Package) HasAssetFile(rootDir string, assetsDir string, filePath string) bool
- func (p *Package) HasAssets(rootDir string, assetsDir string) bool
- func (p *Package) HasCache(rootDir string, cacheDir string) bool
- func (p *Package) HasCacheFile(rootDir, cacheDir, filePath string) bool
- func (p *Package) MakeAssets(rootDir string, cacheDir string, assetsDir string, filePath string, src string) error
- func (p *Package) MakeAssetsContext(ctx context.Context, rootDir, cacheDir, assetsDir, filePath, src string) error
- func (p *Package) MakeCache(rootDir string, cacheDir string, filePath string, src string) error
- func (p *Package) MakeCacheContext(ctx context.Context, rootDir, cacheDir, filePath, src string) error
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileNameMin ¶ added in v1.3.0
Types ¶
type Package ¶
type Package struct {
Name string
Version string
Provider Provider
Require Includes // Patterns to specify which files to include
}
func (*Package) AssetsAt ¶ added in v1.4.0
AssetsAt reads assets below rootDir while keeping browser URLs relative to assetsDir. RootDir is a filesystem location, not a public URL prefix.
func (*Package) AssetsDir ¶
AssetsDir returns the assets dir for the current package, we will store all files in here
func (*Package) CacheDir ¶
CacheDir returns the cache dir for the current package, we will store all files in here
func (*Package) CacheFiles ¶ added in v1.4.0
CacheFiles reads the versioned cache with paths relative to the package.
func (*Package) HasAssetFile ¶ added in v0.5.0
func (*Package) HasCacheFile ¶ added in v1.4.0
HasCacheFile reports whether one complete cache file is present.
func (*Package) MakeAssets ¶
func (p *Package) MakeAssets(rootDir string, cacheDir string, assetsDir string, filePath string, src string) error
MakeAssets copies the cache files to the asset path without the version
func (*Package) MakeAssetsContext ¶ added in v1.4.0
func (p *Package) MakeAssetsContext(ctx context.Context, rootDir, cacheDir, assetsDir, filePath, src string) error
MakeAssetsContext copies a complete cache file or downloads it atomically.
Click to show internal directories.
Click to hide internal directories.