Documentation
¶
Index ¶
- Constants
- func AllSources(register assetfsapi.LocalSourceRegister, ctx context.Context) (sources []assetfsapi.LocalSource)
- func Digest(pth string) (digest *[sha256.Size]byte, err error)
- func FilePath(pth ...string) string
- func GetNames(ctx context.Context) (names []string)
- func GetSources(ctx context.Context) (sources []assetfsapi.LocalSource)
- func SetNames(ctx context.Context, names ...string) context.Context
- func SetSources(ctx context.Context, sources ...assetfsapi.LocalSource) context.Context
- func UnshiftNames(ctx context.Context, names ...string) context.Context
- func UnshiftSources(ctx context.Context, sources ...assetfsapi.LocalSource) context.Context
- type File
- func (f *File) Appender() (io.WriteCloser, error)
- func (f *File) Data() ([]byte, error)
- func (f *File) DataS() (string, error)
- func (f *File) Digest() (d [sha256.Size]byte)
- func (f File) GetFileInfo() os.FileInfo
- func (f *File) ImportLocal(localPath, name string, info os.FileInfo) (err error)
- func (f *File) MustData() []byte
- func (f *File) MustDataS() string
- func (f *File) Open() (io.Reader, error)
- func (f *File) Reader() (io.ReadCloser, error)
- func (f *File) RealPath() string
- func (f *File) Type() api.FileType
- func (f *File) Writer() (io.WriteCloser, error)
- type FileInfo
- type LocalSourcesAttribute
- type SourceDir
- type SourceDirInfo
- type Sources
Constants ¶
View Source
const ( CtxNames contextKey = iota CtxSources )
Variables ¶
This section is empty.
Functions ¶
func AllSources ¶
func AllSources(register assetfsapi.LocalSourceRegister, ctx context.Context) (sources []assetfsapi.LocalSource)
func GetSources ¶
func GetSources(ctx context.Context) (sources []assetfsapi.LocalSource)
func SetSources ¶
func SetSources(ctx context.Context, sources ...assetfsapi.LocalSource) context.Context
func UnshiftSources ¶
func UnshiftSources(ctx context.Context, sources ...assetfsapi.LocalSource) context.Context
Types ¶
type File ¶
type File struct {
FileInfo
// contains filtered or unexported fields
}
func (File) GetFileInfo ¶
func (*File) ImportLocal ¶
type FileInfo ¶
type FileInfo = api.BasicFileInfo
type LocalSourcesAttribute ¶
type LocalSourcesAttribute struct {
// contains filtered or unexported fields
}
func (*LocalSourcesAttribute) LocalSources ¶
func (a *LocalSourcesAttribute) LocalSources() assetfsapi.LocalSourceRegister
func (*LocalSourcesAttribute) SetLocalSources ¶
func (a *LocalSourcesAttribute) SetLocalSources(localSources assetfsapi.LocalSourceRegister)
type SourceDir ¶
type SourceDir struct {
Path string
}
func NewSourceDir ¶
func (*SourceDir) Get ¶
func (d *SourceDir) Get(name string) (info assetfsapi.LocalSourceInfo, err error)
type SourceDirInfo ¶
func (SourceDirInfo) Path ¶
func (info SourceDirInfo) Path() string
type Sources ¶
type Sources struct {
ByName map[string]assetfsapi.LocalSource
}
func NewSources ¶
func NewSources(byName ...map[string]assetfsapi.LocalSource) *Sources
func (*Sources) Get ¶
func (m *Sources) Get(name string) assetfsapi.LocalSource
func (*Sources) Register ¶
func (m *Sources) Register(name string, src assetfsapi.LocalSource)
Click to show internal directories.
Click to hide internal directories.