https://github.com/vanvanni/lampofs
LampoFS - Go library that makes working with different storage systems easy, simple and minimal.
https://github.com/vanvanni/lampofs
files filesystem go golang local memory s3 storage
Last synced: 11 months ago
JSON representation
LampoFS - Go library that makes working with different storage systems easy, simple and minimal.
- Host: GitHub
- URL: https://github.com/vanvanni/lampofs
- Owner: vanvanni
- License: mit
- Created: 2025-08-02T22:44:29.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-02T22:50:08.000Z (11 months ago)
- Last Synced: 2025-08-03T00:19:56.213Z (11 months ago)
- Topics: files, filesystem, go, golang, local, memory, s3, storage
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LampoFS - Go Filesystem Library
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!
## Simple Reference
### Lampo Methods
- `Read(path string) (io.ReadCloser, error)` - Read a file
- `Write(path string, data []byte) error` - Write a new file (fails if file exists)
- `Put(path string, data []byte) error` - Create or overwrite a file
- `Delete(path string) error` - Delete a file
- `Update(path string, data []byte, prepend bool) error` - Append or prepend to a file
- `On(handler func(event LampEvent))` - Register an event listener
### LampEvent
Events fired by the filesystem operations:
- `Type`: "READ", "WRITE", "PUT", "DELETE", "APPEND", "PREPEND"
- `Path`: Path of the file
- `Timestamp`: Unix timestamp of the event
- `Data`: Additional data (size of data for write operations)
## Testing
Run tests with:
```bash
# Run tests with gotestsum (beautiful output)
make test
```
## License
MIT