Skip to content

Commit 4941a11

Browse files
committed
jsonrpc2: sort types
1 parent 3b86065 commit 4941a11

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

jsonrpc2.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,6 @@ type Interface interface {
2222
Wait(ctx context.Context) error
2323
}
2424

25-
var _ Interface = (*Conn)(nil)
26-
27-
// Conn is a JSON RPC 2 client server connection.
28-
// Conn is bidirectional; it does not have a designated server or client end.
29-
type Conn struct {
30-
handle Handler
31-
cancel Canceler
32-
stream Stream
33-
done chan struct{}
34-
err error
35-
seq int64 // must only be accessed using atomic operations
36-
pendingMu sync.Mutex // protects the pending map
37-
pending map[ID]chan *Response
38-
}
39-
4025
// Handler is an option you can pass to NewConn to handle incoming requests.
4126
// If the request returns false from IsNotify then the Handler must eventually
4227
// call Reply on the Conn with the supplied request.
@@ -53,6 +38,21 @@ type Handler func(context.Context, *Conn, *Request)
5338
// instead.
5439
type Canceler func(context.Context, *Conn, *Request)
5540

41+
// Conn is a JSON RPC 2 client server connection.
42+
// Conn is bidirectional; it does not have a designated server or client end.
43+
type Conn struct {
44+
handle Handler
45+
cancel Canceler
46+
stream Stream
47+
done chan struct{}
48+
err error
49+
seq int64 // must only be accessed using atomic operations
50+
pendingMu sync.Mutex // protects the pending map
51+
pending map[ID]chan *Response
52+
}
53+
54+
var _ Interface = (*Conn)(nil)
55+
5656
// NewConn creates a new connection object that reads and writes messages from
5757
// the supplied stream and dispatches incoming messages to the supplied handler.
5858
func NewConn(ctx context.Context, s Stream, options ...interface{}) *Conn {

0 commit comments

Comments
 (0)