-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
327 additions
and
525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package rbforwarder | ||
|
||
// Config stores the configuration for a forwarder | ||
type Config struct { | ||
Retries int | ||
Backoff int | ||
Workers int | ||
QueueSize int | ||
MaxMessages int | ||
MaxBytes int | ||
ShowCounter int | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package pipeline | ||
|
||
// Decoder is the component that parses a raw buffer to a structure | ||
type Decoder interface { | ||
Init(int) error | ||
Decode(*Message) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package pipeline | ||
|
||
// Encoder serializes a data structure to a output buffer | ||
type Encoder interface { | ||
Init(int) error | ||
Encode(*Message) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package pipeline | ||
|
||
import "bytes" | ||
|
||
// Message is used to send data through the pipeline | ||
type Message struct { | ||
InputBuffer *bytes.Buffer // The original data from the source | ||
Data interface{} // Can be used to store the data once it has been parsed | ||
OutputBuffer *bytes.Buffer // The data that will be sent by the sender | ||
Metadata map[string]interface{} // Opaque | ||
|
||
Report Report | ||
} | ||
|
||
// Report is used by the source to obtain the status of a sent message | ||
type Report struct { | ||
ID uint64 // Unique ID for the report, used to maintain sequence | ||
Status string // Result of the sending | ||
StatusCode int // Result of the sending | ||
Retries int | ||
Metadata map[string]interface{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package pipeline | ||
|
||
// Processor performs operations on a data structure | ||
type Processor interface { | ||
Init(int) error | ||
Process(message *Message) (bool, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package pipeline | ||
|
||
// Sender takes a raw buffer and sent it using a network protocol | ||
type Sender interface { | ||
Init(int, chan *Message) error | ||
OnMessage(*Message) error | ||
} |
Oops, something went wrong.