Documentation
¶
Overview ¶
FS interface to read and write.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompleteFS ¶
type CompleteFS interface {
CreateOpener
// Read files tree and return the index of all regular file.
FileIndex() ([]string, error)
// Remove path of a file.
Remove(path string) error
}
A full feature FS.
func Memory ¶
func Memory() CompleteFS
func Os ¶
func Os(dir string) CompleteFS
type CreateOpener ¶
type Creator ¶
type Creator interface {
Create(path string) (io.WriteCloser, error)
}
A FS to create and write file content.
type Opener ¶
type Opener interface {
Open(path string) (io.ReadCloser, error)
}
A FS to open file and read the content.
type SitemapWatcher ¶
type SitemapWatcher struct {
Creator Creator
// Add is called on each .WriteFile, return true to keep the path.
Add func(path string, data []byte) (keep bool)
// contains filtered or unexported fields
}
SitemapWatcher collect all HTML path to create a sitemap.
func Sitemap ¶
func Sitemap(sub *Creator) *SitemapWatcher
Sitemap replaces sub with a new SitemapWatcher and return it.
func (*SitemapWatcher) Create ¶
func (watcher *SitemapWatcher) Create(path string) (io.WriteCloser, error)
func (*SitemapWatcher) Sitemap ¶
func (watcher *SitemapWatcher) Sitemap(host string) []byte
Sitemap generates a simple sitemap file (one url by line).
The host prefix all line. Host must not end by a '/'. Valid example: `sitemap.Sitemap("https://example.com")`
Click to show internal directories.
Click to hide internal directories.