Documentation ¶
Overview ¶
Package loader abstracts the reading document at given url.
It allows developers to register loaders for different uri schemes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(url string) (io.ReadCloser, error)
Load loads the document at given url and returns []byte, if successful.
If no Loader is registered against the URI Scheme, then it returns *SchemeNotRegisteredError
func UnRegister ¶
func UnRegister(scheme string)
UnRegister unregisters the registered loader(if any) for given URI Scheme.
Types ¶
type Loader ¶
type Loader interface {
Load(url string) (io.ReadCloser, error)
}
Loader is the interface that wraps the basic Load method.
Load loads the document at given url and returns []byte, if successful.
type SchemeNotRegisteredError ¶
type SchemeNotRegisteredError string
SchemeNotRegisteredError is the error type returned by Load function. It tells that no Loader is registered for that URL Scheme.
func (SchemeNotRegisteredError) Error ¶
func (s SchemeNotRegisteredError) Error() string
Click to show internal directories.
Click to hide internal directories.