Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSLocator ¶
type FSLocator struct {
// contains filtered or unexported fields
}
FSLocator is an implementation of ReadLocator that uses the fs.FS abstraction to load resources, allowing the API to be used with embedded files.
func NewFSLocator ¶
NewFSLocator returns a new instance of *FSLocator that uses the specified fs.FS to access resources.
func (*FSLocator) ReadResource ¶
func (l *FSLocator) ReadResource(path string) (io.ReadCloser, error)
type FileLocator ¶
type FileLocator struct {
// contains filtered or unexported fields
}
FileLocator is an implementation of ReadLocator and WriteLocator that uses the local filesystem to access resources.
func NewFileLocator ¶
func NewFileLocator(dir string) *FileLocator
NewFileLocator returns a new *FileLocator that is configured to access resources located on the local filesystem.
func (*FileLocator) ReadResource ¶
func (l *FileLocator) ReadResource(path string) (io.ReadCloser, error)
func (*FileLocator) WriteResource ¶
func (l *FileLocator) WriteResource(path string) (io.WriteCloser, error)
type ReadLocator ¶
type ReadLocator interface { // ReadResource opens the resource at the specified path for reading. ReadResource(path string) (io.ReadCloser, error) }
ReadLocator represents a logic by which resources can be opened for reading based off of a path.
type WriteLocator ¶
type WriteLocator interface { // WriteResource opens the resource at the specified path for writing. WriteResource(path string) (io.WriteCloser, error) }
WriteLocator represents a logic by which resources can be opened for writing based off of a path.