interface.go 403 Bytes
Newer Older
Jeromy's avatar
Jeromy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package frame

import (
	"io"
)

type Transport interface {
	WriteFrame(WFrame) error
	ReadFrame() (RFrame, error)
	Close() error
}

// A frame can read and write itself to a serializer/deserializer
type RFrame interface {
	StreamId() StreamId
	Type() FrameType
	readFrom(deserializer) error
}

type WFrame interface {
	writeTo(serializer) error
}

type deserializer io.Reader
type serializer io.Writer