1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-18 13:10:02 +02:00

Expose NoopHandler

This commit is contained in:
Jose Garcia 2021-11-25 16:58:13 +00:00 committed by GitHub
parent c9c77b6bb9
commit e8229febb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 12 deletions

View file

@ -303,6 +303,12 @@ type Handler interface {
Handle(context.Context, *Conn, *Request)
}
// NoopHandler is a Handler that does nothing. It is useful for
// creating a Handler that can be used as a default handler. It is also
// useful for testing.
type NoopHandler struct {}
func (NoopHandler) Handle(ctx context.Context, conn *Conn, req *Request) {}
// ID represents a JSON-RPC 2.0 request ID, which may be either a
// string or number (or null, which is unsupported).
type ID struct {