Documentation ¶
Index ¶
- func AnyStubsInStubs(src, tgt PageStubs) (found bool)
- func CheckForFileData(fs FileSystem, url, mount string) (data []byte, mime, path string, ok bool)
- func EnumerateCheckPaths(src string) (checkPaths []string)
- func FileExists(path string) (exists bool)
- func FindFileMime(path string) (mime string, err error)
- func FindFileShasum(path string) (shasum string, err error)
- func ListAllDirs(path string) (dirs []string, err error)
- func ListAllFiles(path string) (files []string, err error)
- func ListDirs(path string) (dirs []string, err error)
- func ListFiles(path string) (files []string, err error)
- func LookupFilePath(fs FileSystem, basePath string, extensions ...string) (path string, present bool)
- func PruneRootFrom[T string | []string](root string, path T) (pruned T)
- func PruneRootFromSlice(root string, slice []string) (pruned []string)
- func PruneRootFromString(root string, path string) (pruned string)
- func PruneRootPrefixes(path string) (pruned string)
- func RegisterFileSystem(mount string, f FileSystem)
- func RegisteredFileSystems() (registered map[string][]FileSystem)
- type File
- type FileSystem
- type GormFileSystem
- type PageStub
- type PageStubs
- type QueryFileSystem
- type RWFileSystem
- type ValueStubPair
- type WrapFileSystem
- func (w WrapFileSystem) CloneROFS() (cloned FileSystem)
- func (w WrapFileSystem) Exists(path string) (exists bool)
- func (w WrapFileSystem) FileCreated(path string) (created int64, err error)
- func (w WrapFileSystem) FileStats(path string) (mime, shasum string, created, updated time.Time, err error)
- func (w WrapFileSystem) FindFilePath(prefix string, extensions ...string) (path string, err error)
- func (w WrapFileSystem) LastModified(path string) (updated int64, err error)
- func (w WrapFileSystem) ListAllDirs(path string) (paths []string, err error)
- func (w WrapFileSystem) ListAllFiles(path string) (paths []string, err error)
- func (w WrapFileSystem) ListDirs(path string) (paths []string, err error)
- func (w WrapFileSystem) ListFiles(path string) (paths []string, err error)
- func (w WrapFileSystem) MimeType(path string) (mime string, err error)
- func (w WrapFileSystem) Name() (name string)
- func (w WrapFileSystem) Open(path string) (file fs.File, err error)
- func (w WrapFileSystem) ReadDir(path string) (entries []fs.DirEntry, err error)
- func (w WrapFileSystem) ReadFile(path string) (data []byte, err error)
- func (w WrapFileSystem) ReadPageMatter(path string) (pm *matter.PageMatter, err error)
- func (w WrapFileSystem) Shasum(path string) (shasum string, err error)
- type WrapRWFileSystem
- func (w WrapRWFileSystem) BeginTransaction()
- func (w WrapRWFileSystem) CloneRWFS() (cloned RWFileSystem)
- func (w WrapRWFileSystem) CommitTransaction()
- func (w WrapRWFileSystem) EndTransaction()
- func (w WrapRWFileSystem) MakeDir(path string, perm os.FileMode) (err error)
- func (w WrapRWFileSystem) MakeDirAll(path string, perm os.FileMode) (err error)
- func (w WrapRWFileSystem) Remove(path string) (err error)
- func (w WrapRWFileSystem) RemoveAll(path string) (err error)
- func (w WrapRWFileSystem) RemovePageMatter(path string) (err error)
- func (w WrapRWFileSystem) RollbackTransaction()
- func (w WrapRWFileSystem) WriteFile(path string, data []byte, perm os.FileMode) (err error)
- func (w WrapRWFileSystem) WritePageMatter(pm *matter.PageMatter) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyStubsInStubs ¶ added in v0.2.0
func CheckForFileData ¶
func CheckForFileData(fs FileSystem, url, mount string) (data []byte, mime, path string, ok bool)
func EnumerateCheckPaths ¶
func FileExists ¶
func FindFileMime ¶
func FindFileShasum ¶
func ListAllDirs ¶
func ListAllFiles ¶
func LookupFilePath ¶ added in v0.2.0
func LookupFilePath(fs FileSystem, basePath string, extensions ...string) (path string, present bool)
func PruneRootFrom ¶ added in v0.2.0
func PruneRootFromSlice ¶ added in v0.2.1
func PruneRootFromString ¶ added in v0.2.1
func PruneRootPrefixes ¶ added in v0.2.0
func RegisterFileSystem ¶
func RegisterFileSystem(mount string, f FileSystem)
func RegisteredFileSystems ¶
func RegisteredFileSystems() (registered map[string][]FileSystem)
Types ¶
type FileSystem ¶
type FileSystem interface { CloneROFS() (cloned FileSystem) Name() (name string) Open(path string) (fh fs.File, err error) ListDirs(path string) (paths []string, err error) ListFiles(path string) (paths []string, err error) ListAllDirs(path string) (paths []string, err error) ListAllFiles(path string) (paths []string, err error) ReadDir(path string) (paths []fs.DirEntry, err error) ReadFile(path string) (content []byte, err error) MimeType(path string) (mime string, err error) Shasum(path string) (shasum string, err error) FileCreated(path string) (created int64, err error) LastModified(path string) (dateTime int64, err error) Exists(path string) (exists bool) FileStats(path string) (mime, shasum string, created, updated time.Time, err error) FindFilePath(path string, extensions ...string) (realpath string, err error) ReadPageMatter(path string) (pm *matter.PageMatter, err error) }
func Wrap ¶
func Wrap(path string, fs FileSystem) (out FileSystem, err error)
type GormFileSystem ¶ added in v0.2.2
type PageStub ¶ added in v0.2.0
type PageStub struct { Origin string FS FileSystem Point string Shasum string Source string Language language.Tag Fallback language.Tag EnjinCtx beContext.Context }
func NewPageStub ¶ added in v0.2.0
type PageStubs ¶ added in v0.2.0
type PageStubs []*PageStub
type QueryFileSystem ¶ added in v0.2.0
type QueryFileSystem interface { FindPathsWithContextKey(path, key string) (found []string, err error) FindPathsWhereContextKeyEquals(path, key string, value interface{}) (found []string, err error) FindPathsWhereContextEquals(path string, conditions map[string]interface{}) (found []string, err error) FindPathsWhereContext(path string, orJsonConditions ...map[string]interface{}) (found []string, err error) }
type RWFileSystem ¶ added in v0.1.0
type RWFileSystem interface { FileSystem CloneRWFS() (cloned RWFileSystem) BeginTransaction() RollbackTransaction() CommitTransaction() EndTransaction() MakeDir(path string, perm os.FileMode) (err error) MakeDirAll(path string, perm os.FileMode) (err error) Remove(path string) (err error) RemoveAll(path string) (err error) WriteFile(path string, data []byte, perm os.FileMode) (err error) WritePageMatter(pm *matter.PageMatter) (err error) RemovePageMatter(path string) (err error) }
func WrapRW ¶ added in v0.1.0
func WrapRW(path string, fs RWFileSystem) (out RWFileSystem, err error)
type ValueStubPair ¶ added in v0.2.0
type ValueStubPair struct { Value interface{} Stub *PageStub }
type WrapFileSystem ¶
type WrapFileSystem struct {
// contains filtered or unexported fields
}
func (WrapFileSystem) CloneROFS ¶ added in v0.2.5
func (w WrapFileSystem) CloneROFS() (cloned FileSystem)
func (WrapFileSystem) Exists ¶
func (w WrapFileSystem) Exists(path string) (exists bool)
func (WrapFileSystem) FileCreated ¶
func (w WrapFileSystem) FileCreated(path string) (created int64, err error)
func (WrapFileSystem) FindFilePath ¶ added in v0.2.0
func (w WrapFileSystem) FindFilePath(prefix string, extensions ...string) (path string, err error)
func (WrapFileSystem) LastModified ¶
func (w WrapFileSystem) LastModified(path string) (updated int64, err error)
func (WrapFileSystem) ListAllDirs ¶
func (w WrapFileSystem) ListAllDirs(path string) (paths []string, err error)
func (WrapFileSystem) ListAllFiles ¶
func (w WrapFileSystem) ListAllFiles(path string) (paths []string, err error)
func (WrapFileSystem) ListDirs ¶
func (w WrapFileSystem) ListDirs(path string) (paths []string, err error)
func (WrapFileSystem) ListFiles ¶
func (w WrapFileSystem) ListFiles(path string) (paths []string, err error)
func (WrapFileSystem) MimeType ¶
func (w WrapFileSystem) MimeType(path string) (mime string, err error)
func (WrapFileSystem) Name ¶
func (w WrapFileSystem) Name() (name string)
func (WrapFileSystem) ReadDir ¶
func (w WrapFileSystem) ReadDir(path string) (entries []fs.DirEntry, err error)
func (WrapFileSystem) ReadFile ¶
func (w WrapFileSystem) ReadFile(path string) (data []byte, err error)
func (WrapFileSystem) ReadPageMatter ¶ added in v0.2.0
func (w WrapFileSystem) ReadPageMatter(path string) (pm *matter.PageMatter, err error)
type WrapRWFileSystem ¶ added in v0.1.0
type WrapRWFileSystem struct { WrapFileSystem // contains filtered or unexported fields }
func (WrapRWFileSystem) BeginTransaction ¶ added in v0.2.5
func (w WrapRWFileSystem) BeginTransaction()
func (WrapRWFileSystem) CloneRWFS ¶ added in v0.2.5
func (w WrapRWFileSystem) CloneRWFS() (cloned RWFileSystem)
func (WrapRWFileSystem) CommitTransaction ¶ added in v0.2.5
func (w WrapRWFileSystem) CommitTransaction()
func (WrapRWFileSystem) EndTransaction ¶ added in v0.2.5
func (w WrapRWFileSystem) EndTransaction()
func (WrapRWFileSystem) MakeDir ¶ added in v0.1.0
func (w WrapRWFileSystem) MakeDir(path string, perm os.FileMode) (err error)
func (WrapRWFileSystem) MakeDirAll ¶ added in v0.1.0
func (w WrapRWFileSystem) MakeDirAll(path string, perm os.FileMode) (err error)
func (WrapRWFileSystem) Remove ¶ added in v0.1.0
func (w WrapRWFileSystem) Remove(path string) (err error)
func (WrapRWFileSystem) RemoveAll ¶ added in v0.1.0
func (w WrapRWFileSystem) RemoveAll(path string) (err error)
func (WrapRWFileSystem) RemovePageMatter ¶ added in v0.2.0
func (w WrapRWFileSystem) RemovePageMatter(path string) (err error)
func (WrapRWFileSystem) RollbackTransaction ¶ added in v0.2.5
func (w WrapRWFileSystem) RollbackTransaction()
func (WrapRWFileSystem) WritePageMatter ¶ added in v0.2.0
func (w WrapRWFileSystem) WritePageMatter(pm *matter.PageMatter) (err error)
Click to show internal directories.
Click to hide internal directories.