Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content struct { Path string Hash string Modified time.Time Raw string Compressed string RawBytes []byte CompressedBytes []byte }
Content represents a single embedded file.
type DiskLoader ¶
func NewOnDisk ¶
func NewOnDisk(root string) *DiskLoader
NewOnDisk creates a new Loader that loads content from disk.
func (*DiskLoader) GetContents ¶
func (l *DiskLoader) GetContents(path string) ([]byte, error)
type EmbeddedLoader ¶
type EmbeddedLoader struct {
// contains filtered or unexported fields
}
func (*EmbeddedLoader) Add ¶
func (l *EmbeddedLoader) Add(c *Content)
Add an embedded file to the Loader.
func (*EmbeddedLoader) GetContents ¶
func (l *EmbeddedLoader) GetContents(path string) ([]byte, error)
func (*EmbeddedLoader) Open ¶
func (l *EmbeddedLoader) Open(name string) (http.File, error)
Open implements http.FileSystem
func (*EmbeddedLoader) ServeHTTP ¶
func (l *EmbeddedLoader) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.