WIP: Add frameconn.go
This commit is contained in:
parent
9c129e431b
commit
1b4e1e8b55
41
frameconn.go
Normal file
41
frameconn.go
Normal file
@ -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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user