https://github.com/arriqaaq/firestorm
Linux pipe like concept implementation in go
https://github.com/arriqaaq/firestorm
data-pipeline go golang linux pipeline pipes-and-filters
Last synced: about 1 year ago
JSON representation
Linux pipe like concept implementation in go
- Host: GitHub
- URL: https://github.com/arriqaaq/firestorm
- Owner: arriqaaq
- Created: 2018-02-12T08:51:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T10:55:36.000Z (about 8 years ago)
- Last Synced: 2025-03-25T12:51:06.200Z (over 1 year ago)
- Topics: data-pipeline, go, golang, linux, pipeline, pipes-and-filters
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-pipes
```
// Example Usage
type LineReader struct {
lines []string
}
func (l LineReader) ProcessData(
msg firestorm.Message,
outChan chan firestorm.Message,
errChan chan error,
) {
for _, line := range l.lines {
var msg firestorm.Message
msg = []byte(line)
outChan <- msg
}
}
type LineParser struct {
}
func (l LineParser) ProcessData(
msg firestorm.Message,
outChan chan firestorm.Message,
errChan chan error,
) {
newMsg := strings.ToUpper(string(msg))
outChan <- []byte(newMsg)
}
type LineOutput struct {
}
func (l LineOutput) ProcessData(
msg firestorm.Message,
outChan chan firestorm.Message,
errChan chan error,
) {
log.Println("load:", string(msg))
}
func main() {
extract := LineReader{}
extract.lines = []string{"save", "our", "souls"}
transform := LineParser{}
load := LineOutput{}
pl := firestorm.NewPipeline(extract, transform, load)
pl.Run()
}
```