Documentation
¶
Overview ¶
Package fs contains an HTTP file system that works with zip contents.
Index ¶
- func DeleteAsset(asset *Asset)
- func Foreach(predicate func(name, context string, f *Asset))
- func Open(name string, context ...string) (*bytes.Reader, error)
- func Register(zipData string)
- func RegisterCustomExternals(cache Cache, opts []AssetOption, maxTryCount int) error
- type Asset
- type AssetOption
- type Cache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Open ¶
Open returns a bytes.Reader for an asset in the given context, or the default context if no context is given.
func Register ¶
func Register(zipData string)
Register registers zip contents data, later used to initialize the statik file system.
func RegisterCustomExternals ¶
func RegisterCustomExternals(cache Cache, opts []AssetOption, maxTryCount int) error
RegisterCustomExternals ensures that the assets are in the cache, and load them from their source if they are not yet available.
Types ¶
type Asset ¶
type Asset struct { AssetOption Etag string `json:"etag"` NameWithSum string `json:"name_with_sum"` Mime string `json:"mime"` // contains filtered or unexported fields }
Asset holds unzipped read-only file contents and file metadata.
func Get ¶
Get returns a dynamic asset for the given context, or the default context if no context is given.
func (*Asset) GzipReader ¶
GzipReader returns a bytes.Reader for the gzipped content of the asset.
Click to show internal directories.
Click to hide internal directories.