Documentation ¶
Index ¶
- Variables
- func Data(info interface{ ... }) (b []byte, err error)
- func DataS(info interface{ ... }) (s string, err error)
- func HttpStaticHandler(fs assetfsapi.Interface) http.Handler
- func IsGzip(b []byte) bool
- func MustData(info interface{ ... }) (b []byte)
- func MustDataS(info interface{ ... }) (s string)
- func NewGlobPattern(pattern string) assetfsapi.GlobPattern
- func NewSimpleGlobPattern(pattern string) assetfsapi.GlobPattern
- func ParseFileType(typ string) (t assetfsapi.FileType)
- func RootPath(fs assetfsapi.Interface) string
- func SaveExecutable(assetName string, fs assetfsapi.Interface, dest string, force ...bool) (err error)
- func SplitGlobPattern(ipattern string) (dir, pattern string)
- func StringifyFileInfo(info assetfsapi.FileInfo) string
- type AssetFileSystem
- func (fs *AssetFileSystem) Compile() error
- func (fs *AssetFileSystem) Dump(cb func(info assetfsapi.FileInfo) error, ignore ...func(pth string) bool) error
- func (fs *AssetFileSystem) DumpC(ctx context.Context, cb func(info assetfsapi.FileInfo) error, ...) error
- func (fs *AssetFileSystem) DumpFiles(cb func(info assetfsapi.FileInfo) error) error
- func (fs *AssetFileSystem) DumpFilesC(ctx context.Context, cb func(info assetfsapi.FileInfo) error) error
- func (fs *AssetFileSystem) GetName() string
- func (fs *AssetFileSystem) GetNameSpace(nameSpace string) (assetfsapi.NameSpacedInterface, error)
- func (fs *AssetFileSystem) GetParent() assetfsapi.Interface
- func (fs *AssetFileSystem) GetPath() string
- func (fs *AssetFileSystem) GetPaths(recursive ...bool) (p []*fileutils.Dir)
- func (fs *AssetFileSystem) NameSpace(nameSpace string) assetfsapi.NameSpacedInterface
- func (fs *AssetFileSystem) NameSpaceFS(nameSpace string) *AssetFileSystem
- func (fs *AssetFileSystem) NameSpaces() (items []assetfsapi.NameSpacedInterface)
- func (fs *AssetFileSystem) OnPathRegister(cb ...assetfsapi.PathRegisterCallback)
- func (fs *AssetFileSystem) PathsFrom(ctx context.Context, pth string, cb func(pth string) error) (err error)
- func (fs *AssetFileSystem) PrependPath(pth string, ignoreExists ...bool) error
- func (fs *AssetFileSystem) PrependPathFS(pth string, ignoreExists ...bool) (assetfsapi.Interface, error)
- func (fs *AssetFileSystem) ReadDir(dir string, cb assetfsapi.CbWalkInfoFunc, skipDir bool) (err error)
- func (fs *AssetFileSystem) RegisterPath(pth string, ignoreExists ...bool) error
- func (fs *AssetFileSystem) RegisterPathFS(pth string, ignoreExists ...bool) (assetfsapi.Interface, error)
- func (fs *AssetFileSystem) RegisterPlugin(plugins ...assetfsapi.Plugin)
- func (fs *AssetFileSystem) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (fs *AssetFileSystem) TreeNames(ctx context.Context, onlyFiles bool, ignore ...func(pth string) bool) (result []assetfsapi.FileInfo, err error)
- type AssetGetter
- func (f *AssetGetter) Asset(path string) (asset assetfsapi.AssetInterface, err error)
- func (f *AssetGetter) AssetC(ctx context.Context, path string) (asset assetfsapi.AssetInterface, err error)
- func (f *AssetGetter) AssetInfo(path string) (assetfsapi.FileInfo, error)
- func (f *AssetGetter) AssetInfoC(ctx context.Context, path string) (assetfsapi.FileInfo, error)
- func (f *AssetGetter) AssetReader() assetfsapi.AssetReaderFunc
- func (f *AssetGetter) AssetReaderC() assetfsapi.AssetReaderFuncC
- func (f *AssetGetter) MustAsset(path string) assetfsapi.AssetInterface
- func (f *AssetGetter) MustAssetC(ctx context.Context, path string) assetfsapi.AssetInterface
- func (f *AssetGetter) MustAssetInfo(path string) assetfsapi.FileInfo
- func (f *AssetGetter) MustAssetInfoC(ctx context.Context, path string) assetfsapi.FileInfo
- func (f *AssetGetter) Provider(providers ...Interface)
- func (f *AssetGetter) Providers() []Interface
- type AssetInterface
- type Compresseder
- type DefaultGlobPattern
- func (gp *DefaultGlobPattern) Glob() glob.Glob
- func (gp *DefaultGlobPattern) Match(value string) bool
- func (gp DefaultGlobPattern) PathFormatter(formatter assetfsapi.PathFormatterFunc) assetfsapi.GlobPattern
- func (gp DefaultGlobPattern) Recursive() assetfsapi.GlobPattern
- func (gp DefaultGlobPattern) Wrap(dir ...string) assetfsapi.GlobPattern
- type Glob
- func (g *Glob) FS() assetfsapi.Interface
- func (g *Glob) GetPattern() assetfsapi.GlobPattern
- func (g *Glob) Info(cb func(info assetfsapi.FileInfo) error) error
- func (g *Glob) InfoOrPanic(cb func(info assetfsapi.FileInfo) error)
- func (g *Glob) Infos() (items []assetfsapi.FileInfo, err error)
- func (g *Glob) InfosOrPanic() []assetfsapi.FileInfo
- func (g *Glob) Name(cb func(pth string, isDir bool) error) error
- func (g *Glob) NameOrPanic(cb func(pth string, isDir bool) error)
- func (g *Glob) Names() (items []string, err error)
- func (g *Glob) NamesOrPanic() []string
- func (g *Glob) SetPattern(pattern assetfsapi.GlobPattern)
- func (g *Glob) SortedInfos() (items []assetfsapi.FileInfo, err error)
- func (g *Glob) SortedNames() (items []string, err error)
- type GlobBase
- type GlobPatter
- type Interface
- type NameSpaceFileInfo
- func (ns *NameSpaceFileInfo) GetFileInfo() os.FileInfo
- func (ns *NameSpaceFileInfo) IsDir() bool
- func (ns *NameSpaceFileInfo) ModTime() time.Time
- func (ns *NameSpaceFileInfo) Mode() os.FileMode
- func (ns *NameSpaceFileInfo) ReadDir(cb func(child assetfsapi.FileInfo) error) (err error)
- func (ns *NameSpaceFileInfo) Reader() (io.ReadCloser, error)
- func (ns *NameSpaceFileInfo) RealPath() string
- func (ns *NameSpaceFileInfo) Size() int64
- func (ns *NameSpaceFileInfo) String() string
- func (ns *NameSpaceFileInfo) Sys() interface{}
- func (NameSpaceFileInfo) Type() assetfsapi.FileType
- func (ns *NameSpaceFileInfo) Writer() (io.WriteCloser, error)
- type NormalPattern
- type RawFileSystem
- type RealDirFileInfo
- func (rf *RealDirFileInfo) Appender() (io.WriteCloser, error)
- func (d *RealDirFileInfo) ReadDir(cb func(child assetfsapi.FileInfo) error) (err error)
- func (rf *RealDirFileInfo) Reader() (io.ReadCloser, error)
- func (rf *RealDirFileInfo) String() string
- func (RealDirFileInfo) Type() assetfsapi.FileType
- func (rf *RealDirFileInfo) Writer() (io.WriteCloser, error)
- type RealFileInfo
- func (rf *RealFileInfo) Appender() (io.WriteCloser, error)
- func (rf *RealFileInfo) GetFileInfo() os.FileInfo
- func (rf *RealFileInfo) Reader() (io.ReadCloser, error)
- func (rf *RealFileInfo) RealPath() string
- func (rf *RealFileInfo) String() string
- func (RealFileInfo) Type() assetfsapi.FileType
- func (rf *RealFileInfo) Writer() (io.WriteCloser, error)
- type StaticHandler
- type Traversable
- func (f *Traversable) Glob(pattern assetfsapi.GlobPattern, cb func(pth string, isDir bool) error) error
- func (f *Traversable) GlobInfo(pattern assetfsapi.GlobPattern, cb func(info assetfsapi.FileInfo) error) error
- func (f *Traversable) NewGlob(pattern assetfsapi.GlobPattern) assetfsapi.Glob
- func (f *Traversable) NewGlobString(pattern string) assetfsapi.Glob
- func (t *Traversable) ReadDir(dir string, cb assetfsapi.CbWalkInfoFunc, skipDir bool) (err error)
- func (t *Traversable) Walk(dir string, cb assetfsapi.CbWalkFunc, mode ...assetfsapi.WalkMode) error
- func (t *Traversable) WalkInfo(dir string, cb assetfsapi.CbWalkInfoFunc, mode ...assetfsapi.WalkMode) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IS_DIR_ERROR = errors.New("Is directory.") IS_NS_ERROR = errors.New("Is name space.") )
View Source
var G = NewGlobPattern
Functions ¶
func HttpStaticHandler ¶
func HttpStaticHandler(fs assetfsapi.Interface) http.Handler
func NewGlobPattern ¶
func NewGlobPattern(pattern string) assetfsapi.GlobPattern
pattern: \f Files, \r dirs
func NewSimpleGlobPattern ¶
func NewSimpleGlobPattern(pattern string) assetfsapi.GlobPattern
pattern: \f Files, \r dirs
func ParseFileType ¶
func ParseFileType(typ string) (t assetfsapi.FileType)
func RootPath ¶
func RootPath(fs assetfsapi.Interface) string
func SaveExecutable ¶
func SplitGlobPattern ¶
func StringifyFileInfo ¶
func StringifyFileInfo(info assetfsapi.FileInfo) string
Types ¶
type AssetFileSystem ¶
type AssetFileSystem struct { assetfsapi.AssetGetterInterface assetfsapi.TraversableInterface local.LocalSourcesAttribute // contains filtered or unexported fields }
AssetFileSystem AssetFS based on FileSystem
func NewAssetFileSystem ¶
func NewAssetFileSystem() *AssetFileSystem
func (*AssetFileSystem) Compile ¶
func (fs *AssetFileSystem) Compile() error
Compile compile assetfs
func (*AssetFileSystem) Dump ¶
func (fs *AssetFileSystem) Dump(cb func(info assetfsapi.FileInfo) error, ignore ...func(pth string) bool) error
func (*AssetFileSystem) DumpC ¶
func (fs *AssetFileSystem) DumpC(ctx context.Context, cb func(info assetfsapi.FileInfo) error, ignore ...func(pth string) bool) error
func (*AssetFileSystem) DumpFiles ¶
func (fs *AssetFileSystem) DumpFiles(cb func(info assetfsapi.FileInfo) error) error
func (*AssetFileSystem) DumpFilesC ¶
func (fs *AssetFileSystem) DumpFilesC(ctx context.Context, cb func(info assetfsapi.FileInfo) error) error
func (*AssetFileSystem) GetName ¶
func (fs *AssetFileSystem) GetName() string
func (*AssetFileSystem) GetNameSpace ¶
func (fs *AssetFileSystem) GetNameSpace(nameSpace string) (assetfsapi.NameSpacedInterface, error)
func (*AssetFileSystem) GetParent ¶
func (fs *AssetFileSystem) GetParent() assetfsapi.Interface
func (*AssetFileSystem) GetPath ¶
func (fs *AssetFileSystem) GetPath() string
func (*AssetFileSystem) GetPaths ¶
func (fs *AssetFileSystem) GetPaths(recursive ...bool) (p []*fileutils.Dir)
func (*AssetFileSystem) NameSpace ¶
func (fs *AssetFileSystem) NameSpace(nameSpace string) assetfsapi.NameSpacedInterface
NameSpace return namespaced filesystem
func (*AssetFileSystem) NameSpaceFS ¶
func (fs *AssetFileSystem) NameSpaceFS(nameSpace string) *AssetFileSystem
NameSpace return namespaced filesystem
func (*AssetFileSystem) NameSpaces ¶
func (fs *AssetFileSystem) NameSpaces() (items []assetfsapi.NameSpacedInterface)
func (*AssetFileSystem) OnPathRegister ¶
func (fs *AssetFileSystem) OnPathRegister(cb ...assetfsapi.PathRegisterCallback)
func (*AssetFileSystem) PrependPath ¶
func (fs *AssetFileSystem) PrependPath(pth string, ignoreExists ...bool) error
PrependPath prepend path to view paths
func (*AssetFileSystem) PrependPathFS ¶
func (fs *AssetFileSystem) PrependPathFS(pth string, ignoreExists ...bool) (assetfsapi.Interface, error)
PrependPath prepend path to view paths
func (*AssetFileSystem) ReadDir ¶
func (fs *AssetFileSystem) ReadDir(dir string, cb assetfsapi.CbWalkInfoFunc, skipDir bool) (err error)
func (*AssetFileSystem) RegisterPath ¶
func (fs *AssetFileSystem) RegisterPath(pth string, ignoreExists ...bool) error
RegisterPath register view paths
func (*AssetFileSystem) RegisterPathFS ¶
func (fs *AssetFileSystem) RegisterPathFS(pth string, ignoreExists ...bool) (assetfsapi.Interface, error)
RegisterPath register view paths
func (*AssetFileSystem) RegisterPlugin ¶
func (fs *AssetFileSystem) RegisterPlugin(plugins ...assetfsapi.Plugin)
func (*AssetFileSystem) ServeHTTP ¶
func (fs *AssetFileSystem) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AssetGetter ¶
type AssetGetter struct { AssetFunc func(ctx context.Context, path string) ([]byte, error) AssetInfoFunc func(ctx context.Context, path string) (assetfsapi.FileInfo, error) // contains filtered or unexported fields }
func (*AssetGetter) Asset ¶
func (f *AssetGetter) Asset(path string) (asset assetfsapi.AssetInterface, err error)
func (*AssetGetter) AssetC ¶
func (f *AssetGetter) AssetC(ctx context.Context, path string) (asset assetfsapi.AssetInterface, err error)
func (*AssetGetter) AssetInfo ¶
func (f *AssetGetter) AssetInfo(path string) (assetfsapi.FileInfo, error)
func (*AssetGetter) AssetInfoC ¶
func (f *AssetGetter) AssetInfoC(ctx context.Context, path string) (assetfsapi.FileInfo, error)
func (*AssetGetter) AssetReader ¶
func (f *AssetGetter) AssetReader() assetfsapi.AssetReaderFunc
func (*AssetGetter) AssetReaderC ¶
func (f *AssetGetter) AssetReaderC() assetfsapi.AssetReaderFuncC
func (*AssetGetter) MustAsset ¶
func (f *AssetGetter) MustAsset(path string) assetfsapi.AssetInterface
func (*AssetGetter) MustAssetC ¶
func (f *AssetGetter) MustAssetC(ctx context.Context, path string) assetfsapi.AssetInterface
func (*AssetGetter) MustAssetInfo ¶
func (f *AssetGetter) MustAssetInfo(path string) assetfsapi.FileInfo
func (*AssetGetter) MustAssetInfoC ¶
func (f *AssetGetter) MustAssetInfoC(ctx context.Context, path string) assetfsapi.FileInfo
func (*AssetGetter) Provider ¶
func (f *AssetGetter) Provider(providers ...Interface)
func (*AssetGetter) Providers ¶
func (f *AssetGetter) Providers() []Interface
type AssetInterface ¶
type AssetInterface = assetfsapi.AssetInterface
type Compresseder ¶
type Compresseder = assetfsapi.Compresseder
type DefaultGlobPattern ¶
type DefaultGlobPattern struct { GlobBase // contains filtered or unexported fields }
func (*DefaultGlobPattern) Glob ¶
func (gp *DefaultGlobPattern) Glob() glob.Glob
func (*DefaultGlobPattern) Match ¶
func (gp *DefaultGlobPattern) Match(value string) bool
func (DefaultGlobPattern) PathFormatter ¶
func (gp DefaultGlobPattern) PathFormatter(formatter assetfsapi.PathFormatterFunc) assetfsapi.GlobPattern
func (DefaultGlobPattern) Recursive ¶
func (gp DefaultGlobPattern) Recursive() assetfsapi.GlobPattern
func (DefaultGlobPattern) Wrap ¶
func (gp DefaultGlobPattern) Wrap(dir ...string) assetfsapi.GlobPattern
type Glob ¶
type Glob struct {
// contains filtered or unexported fields
}
func NewGlob ¶
func NewGlob(fs assetfsapi.Interface, pattern assetfsapi.GlobPattern) *Glob
func (*Glob) FS ¶
func (g *Glob) FS() assetfsapi.Interface
func (*Glob) GetPattern ¶
func (g *Glob) GetPattern() assetfsapi.GlobPattern
func (*Glob) InfoOrPanic ¶
func (g *Glob) InfoOrPanic(cb func(info assetfsapi.FileInfo) error)
func (*Glob) InfosOrPanic ¶
func (g *Glob) InfosOrPanic() []assetfsapi.FileInfo
func (*Glob) NamesOrPanic ¶
func (*Glob) SetPattern ¶
func (g *Glob) SetPattern(pattern assetfsapi.GlobPattern)
func (*Glob) SortedInfos ¶
func (g *Glob) SortedInfos() (items []assetfsapi.FileInfo, err error)
func (*Glob) SortedNames ¶
type GlobBase ¶
type GlobBase struct {
// contains filtered or unexported fields
}
func (*GlobBase) AllowFiles ¶
func (*GlobBase) GetPathFormatter ¶
func (gp *GlobBase) GetPathFormatter() assetfsapi.PathFormatterFunc
func (*GlobBase) IsRecursive ¶
type GlobPatter ¶
type GlobPatter = assetfsapi.GlobPattern
type Interface ¶
type Interface = assetfsapi.Interface
func FakeFileSystem ¶
func FakeFileSystem() Interface
type NameSpaceFileInfo ¶
type NameSpaceFileInfo struct { assetfsapi.BasicFileInfo // contains filtered or unexported fields }
func (*NameSpaceFileInfo) GetFileInfo ¶
func (ns *NameSpaceFileInfo) GetFileInfo() os.FileInfo
func (*NameSpaceFileInfo) IsDir ¶
func (ns *NameSpaceFileInfo) IsDir() bool
func (*NameSpaceFileInfo) ModTime ¶
func (ns *NameSpaceFileInfo) ModTime() time.Time
func (*NameSpaceFileInfo) Mode ¶
func (ns *NameSpaceFileInfo) Mode() os.FileMode
func (*NameSpaceFileInfo) ReadDir ¶
func (ns *NameSpaceFileInfo) ReadDir(cb func(child assetfsapi.FileInfo) error) (err error)
func (*NameSpaceFileInfo) Reader ¶
func (ns *NameSpaceFileInfo) Reader() (io.ReadCloser, error)
func (*NameSpaceFileInfo) RealPath ¶
func (ns *NameSpaceFileInfo) RealPath() string
func (*NameSpaceFileInfo) Size ¶
func (ns *NameSpaceFileInfo) Size() int64
func (*NameSpaceFileInfo) String ¶
func (ns *NameSpaceFileInfo) String() string
func (*NameSpaceFileInfo) Sys ¶
func (ns *NameSpaceFileInfo) Sys() interface{}
func (NameSpaceFileInfo) Type ¶
func (NameSpaceFileInfo) Type() assetfsapi.FileType
func (*NameSpaceFileInfo) Writer ¶
func (ns *NameSpaceFileInfo) Writer() (io.WriteCloser, error)
type NormalPattern ¶
type NormalPattern struct {
GlobBase
}
func (*NormalPattern) Match ¶
func (gp *NormalPattern) Match(value string) bool
func (NormalPattern) PathFormatter ¶
func (gp NormalPattern) PathFormatter(formatter assetfsapi.PathFormatterFunc) assetfsapi.GlobPattern
func (*NormalPattern) Recursive ¶
func (gp *NormalPattern) Recursive() assetfsapi.GlobPattern
func (NormalPattern) Wrap ¶
func (gp NormalPattern) Wrap(dir ...string) assetfsapi.GlobPattern
type RawFileSystem ¶
type RawFileSystem struct {
*AssetFileSystem
}
type RealDirFileInfo ¶
type RealDirFileInfo struct {
*RealFileInfo
}
func (*RealDirFileInfo) Appender ¶
func (rf *RealDirFileInfo) Appender() (io.WriteCloser, error)
func (*RealDirFileInfo) ReadDir ¶
func (d *RealDirFileInfo) ReadDir(cb func(child assetfsapi.FileInfo) error) (err error)
func (*RealDirFileInfo) Reader ¶
func (rf *RealDirFileInfo) Reader() (io.ReadCloser, error)
func (*RealDirFileInfo) String ¶
func (rf *RealDirFileInfo) String() string
func (RealDirFileInfo) Type ¶
func (RealDirFileInfo) Type() assetfsapi.FileType
func (*RealDirFileInfo) Writer ¶
func (rf *RealDirFileInfo) Writer() (io.WriteCloser, error)
type RealFileInfo ¶
type RealFileInfo struct { assetfsapi.BasicFileInfo // contains filtered or unexported fields }
func NewRealFileInfo ¶
func NewRealFileInfo(basicFileInfo assetfsapi.BasicFileInfo, realPath string) *RealFileInfo
func (*RealFileInfo) Appender ¶
func (rf *RealFileInfo) Appender() (io.WriteCloser, error)
func (*RealFileInfo) GetFileInfo ¶
func (rf *RealFileInfo) GetFileInfo() os.FileInfo
func (*RealFileInfo) Reader ¶
func (rf *RealFileInfo) Reader() (io.ReadCloser, error)
func (*RealFileInfo) RealPath ¶
func (rf *RealFileInfo) RealPath() string
func (*RealFileInfo) String ¶
func (rf *RealFileInfo) String() string
func (RealFileInfo) Type ¶
func (RealFileInfo) Type() assetfsapi.FileType
func (*RealFileInfo) Writer ¶
func (rf *RealFileInfo) Writer() (io.WriteCloser, error)
type StaticHandler ¶
type StaticHandler struct { EtagTimeLife time.Duration FS assetfsapi.Interface // contains filtered or unexported fields }
func NewStaticHandler ¶
func NewStaticHandler(fs assetfsapi.Interface) *StaticHandler
func (*StaticHandler) ServeAsset ¶
func (this *StaticHandler) ServeAsset(w http.ResponseWriter, r *http.Request, pth string, notFound ...bool)
func (*StaticHandler) ServeHTTP ¶
func (this *StaticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Traversable ¶
type Traversable struct { FS Interface WalkFunc assetfsapi.WalkFunc WalkInfoFunc assetfsapi.WalkInfoFunc ReadDirFunc func(dir string, cb assetfsapi.CbWalkInfoFunc, skipDir bool) error GlobFunc assetfsapi.GlobFunc GlobInfoFunc assetfsapi.GlobInfoFunc }
func (*Traversable) Glob ¶
func (f *Traversable) Glob(pattern assetfsapi.GlobPattern, cb func(pth string, isDir bool) error) error
func (*Traversable) GlobInfo ¶
func (f *Traversable) GlobInfo(pattern assetfsapi.GlobPattern, cb func(info assetfsapi.FileInfo) error) error
func (*Traversable) NewGlob ¶
func (f *Traversable) NewGlob(pattern assetfsapi.GlobPattern) assetfsapi.Glob
func (*Traversable) NewGlobString ¶
func (f *Traversable) NewGlobString(pattern string) assetfsapi.Glob
func (*Traversable) ReadDir ¶
func (t *Traversable) ReadDir(dir string, cb assetfsapi.CbWalkInfoFunc, skipDir bool) (err error)
func (*Traversable) Walk ¶
func (t *Traversable) Walk(dir string, cb assetfsapi.CbWalkFunc, mode ...assetfsapi.WalkMode) error
func (*Traversable) WalkInfo ¶
func (t *Traversable) WalkInfo(dir string, cb assetfsapi.CbWalkInfoFunc, mode ...assetfsapi.WalkMode) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.