mirror of
https://github.com/golang/go
synced 2024-11-18 15:14:44 -07:00
internal/jsonrpc2: remove Direction
It is no longer used after the changes to the logging system. Change-Id: I7b96fb8297eb66f2ebad67c74c82fa7ed96c3139 Reviewed-on: https://go-review.googlesource.com/c/tools/+/227485 Run-TryBot: Ian Cottrell <iancottrell@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
parent
888a00fb34
commit
9ee5ef7a2c
@ -18,28 +18,6 @@ import (
|
|||||||
// The handler should return ErrNotHandled if it could not handle the request.
|
// The handler should return ErrNotHandled if it could not handle the request.
|
||||||
type Handler func(context.Context, *Request) error
|
type Handler func(context.Context, *Request) error
|
||||||
|
|
||||||
// Direction is used to indicate to a logger whether the logged message was being
|
|
||||||
// sent or received.
|
|
||||||
type Direction bool
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Send indicates the message is outgoing.
|
|
||||||
Send = Direction(true)
|
|
||||||
// Receive indicates the message is incoming.
|
|
||||||
Receive = Direction(false)
|
|
||||||
)
|
|
||||||
|
|
||||||
func (d Direction) String() string {
|
|
||||||
switch d {
|
|
||||||
case Send:
|
|
||||||
return "send"
|
|
||||||
case Receive:
|
|
||||||
return "receive"
|
|
||||||
default:
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MethodNotFound is a Handler that replies to all call requests with the
|
// MethodNotFound is a Handler that replies to all call requests with the
|
||||||
// standard method not found response.
|
// standard method not found response.
|
||||||
// This should normally be the final handler in a chain.
|
// This should normally be the final handler in a chain.
|
||||||
|
Loading…
Reference in New Issue
Block a user