-
Notifications
You must be signed in to change notification settings - Fork 61
/
qrpc.go
32 lines (27 loc) · 826 Bytes
/
qrpc.go
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
26
27
28
29
30
31
32
package qrpc
// Cmd is for multiplexer
type Cmd uint32
// PacketFlag defines flags for qrpc
type PacketFlag uint8
const (
// StreamFlag means packet is streamed
StreamFlag PacketFlag = 1 << iota
// StreamEndFlag denotes the end of a stream
StreamEndFlag
// NBFlag means it should be handled nonblockly
NBFlag
// CancelFlag cancels a stream (TODO)
CancelFlag
// ErrorFlag indicate client should close the specific stream
ErrorFlag
// CompressFlag indicate packet is compressed (TODO)
CompressFlag
// PushFlag mean the frame is pushed from server
PushFlag
)
// contextKey is a value for use with context.WithValue. It's used as
// a pointer so it fits in an interface{} without allocation.
type contextKey struct {
name string
}
func (k *contextKey) String() string { return "qrpc context value " + k.name }