Documentation ¶
Index ¶
- Variables
- type Box
- func (b *Box) Bytes(name string) ([]byte, error)
- func (b *Box) HTTPBox() *HTTPBox
- func (b *Box) IsAppended() bool
- func (b *Box) IsEmbedded() bool
- func (b *Box) MustBytes(name string) []byte
- func (b *Box) MustString(name string) string
- func (b *Box) Open(name string) (*File, error)
- func (b *Box) String(name string) (string, error)
- func (b *Box) Time() time.Time
- type File
- type HTTPBox
Constants ¶
This section is empty.
Variables ¶
var Debug = false
Debug can be set to true to enable debugging.
var ErrNotImplemented = errors.New("not implemented yet")
Error indicating some function is not implemented yet (but available to satisfy an interface)
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
Box abstracts a directory for resources/files. It can either load files from disk, or from embedded code (when `rice --embed` was ran).
func FindBox ¶
FindBox returns a Box instance for given name. When the given name is a relative path, it's base path will be the calling pkg/cmd's source root. When the given name is absolute, it's absolute. derp. Make sure the path doesn't contain any sensitive information as it might be placed into generated go source (embedded).
func MustFindBox ¶
MustFindBox returns a Box instance for given name, like FindBox does. It does not return an error, instead it panics when an error occurs.
func (*Box) IsAppended ¶
IsAppended indicates wether this box was appended to the application
func (*Box) IsEmbedded ¶
IsEmbedded indicates wether this box was embedded into the application
func (*Box) MustBytes ¶
MustBytes returns the content of the file with given name as []byte. panic's on error.
func (*Box) MustString ¶
MustString returns the content of the file with given name as string. panic's on error.
func (*Box) Open ¶
Open opens a File from the box If there is an error, it will be of type *os.PathError.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File abstracts file methods so the user doesn't see the difference between rice.virtualFile, rice.virtualDir and os.File This type implements the io.Reader, io.Seeker, io.Closer and http.File interfaces
func (*File) Close ¶
Close is like (*os.File).Close() Visit http://golang.org/pkg/os/#File.Close for more information
func (*File) Read ¶
Read is like (*os.File).Read() Visit http://golang.org/pkg/os/#File.Read for more information
func (*File) Readdir ¶
Readdir is like (*os.File).Readdir() Visit http://golang.org/pkg/os/#File.Readdir for more information
func (*File) Seek ¶
Seek is like (*os.File).Seek() Visit http://golang.org/pkg/os/#File.Seek for more information