LampoFS is a Go library that makes working with different storage systems easy and simple. It gives you one simple way to handle files whether they're on your local computer, in cloud storage like S3, or just in memory. No need to learn different APIs for each storage type!
Read(path string) (io.ReadCloser, error)- Read a fileWrite(path string, data []byte) error- Write a new file (fails if file exists)Put(path string, data []byte) error- Create or overwrite a fileDelete(path string) error- Delete a fileUpdate(path string, data []byte, prepend bool) error- Append or prepend to a fileOn(handler func(event LampEvent))- Register an event listener
Events fired by the filesystem operations:
Type: "READ", "WRITE", "PUT", "DELETE", "APPEND", "PREPEND"Path: Path of the fileTimestamp: Unix timestamp of the eventData: Additional data (size of data for write operations)
Run tests with:
# Run tests with gotestsum (beautiful output)
make testMIT