add the concept of routes input/output

This commit is contained in:
Joel Wetzell
2025-11-19 18:33:04 -06:00
parent 8e0f25abe9
commit 0e903eba2f
11 changed files with 193 additions and 35 deletions

View File

@@ -13,7 +13,7 @@ func NewByteSeparatorFramer(separator []byte) *ByteSeparatorFramer {
return &ByteSeparatorFramer{separator: separator, buffer: []byte{}}
}
func (bsf *ByteSeparatorFramer) Frame(data []byte) [][]byte {
func (bsf *ByteSeparatorFramer) Decode(data []byte) [][]byte {
messages := [][]byte{}
bsf.buffer = append(bsf.buffer, data...)
@@ -28,6 +28,10 @@ func (bsf *ByteSeparatorFramer) Frame(data []byte) [][]byte {
return messages
}
func (bsf *ByteSeparatorFramer) Encode(data []byte) []byte {
return append(data, bsf.separator...)
}
func (bsf *ByteSeparatorFramer) Clear() {
bsf.buffer = []byte{}
}