Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustReadAll ¶
MustReadAll returns the full content of the specified static file or panics. It is intended for use during program initialization.
func ReadAll ¶
ReadAll reads the complete contents of a static file given its clean registered path. It reports io.ErrNotExist if no such path is registered.
func Register ¶
func Register(path, data string)
Register the contents of a file under the given path. The path is cleaned by filepath.Clean, and any leading path separators are discarded. This function will panic if path == "" or if the cleaned path has previously been registered.
This function is meant to be used from generated code, and should not ordinarily be called directly by clients of the library.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
A File is a read-only view of the contents of a static file. It implements io.Reader, io.ReaderAt, io.Seeker, and io.WriterTo.
func Open ¶
Open opens a static file given its clean registered path. It reports io.ErrNotExist if no such path is registered.
Directories
¶
| Path | Synopsis |
|---|---|
|
Binary compiledata generates Go source text containing encoded file data, for use with the github.com/creachadair/staticfile package.
|
Binary compiledata generates Go source text containing encoded file data, for use with the github.com/creachadair/staticfile package. |
|
internal
|
|
|
bits
Package bits provides support routines for encoding and decoding data.
|
Package bits provides support routines for encoding and decoding data. |