Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
goframe
✓ github.com/smallnest/goframe
Decodes a length-field-based frame from raw bytes.
package main
import (
"fmt"
"github.com/smallnest/goframe"
)
func main() {
// Create a frame decoder with a 4-byte length field at offset 0
decoder := goframe.NewLengthFieldBasedFrameDecoder(1024, 0, 4, 0, 4)
data := []byte{0x00, 0x00, 0x00, 0x05, 'h', 'e', 'l', 'l', 'o'}
frames, err := decoder.Decode(data)
if err != nil {
panic(err)
}
for _, frame := range frames {
fmt.Printf("Frame: %s\n", string(frame))
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.0.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.