From 1b4e1e8b55fb953e8c6cc97674c157e76b04c047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Krzy=C5=BCanowski?= Date: Sat, 28 Dec 2024 01:59:13 +0100 Subject: [PATCH] WIP: Add frameconn.go --- frameconn.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 frameconn.go diff --git a/frameconn.go b/frameconn.go new file mode 100644 index 0000000..0c77807 --- /dev/null +++ b/frameconn.go @@ -0,0 +1,41 @@ +package main + +import "io" + +type Typed interface { + Type() uint32 +} + +type Framed interface { + Value() []byte +} + +type Frame interface { + Typed + Framed +} + +type frame struct { + TypeID uint32 + ValueBytes []byte +} + +func (f frame) Type() uint32 { + return f.TypeID +} + +func (f frame) Value() []byte { + return f.ValueBytes +} + +type FrameReadWriter struct { + rw io.ReadWriter +} + +func (FrameReadWriter) ReadFrame() (Frame, error) { + return nil, nil +} + +func (FrameReadWriter) WriteFrame(f Frame) error { + return nil +}