• zhiqiangxu's avatar
    rpc: add method to test for subscription support (#25942) · 6f08c2f3
    zhiqiangxu authored
    This adds two ways to check for subscription support. First, one can now check
    whether the transport method (HTTP/WS/etc.) is capable of subscriptions using
    the new Client.SupportsSubscriptions method.
    
    Second, the error returned by Subscribe can now reliably be tested using this
    pattern:
        
        sub, err := client.Subscribe(...)
        if errors.Is(err, rpc.ErrNotificationsUnsupported) {
            // no subscription support
        }
    
    ---------
    Co-authored-by: 's avatarFelix Lange <fjl@twurst.com>
    6f08c2f3
Name
Last commit
Last update
..
testdata Loading commit data...
client.go Loading commit data...
client_example_test.go Loading commit data...
client_opt.go Loading commit data...
client_opt_test.go Loading commit data...
client_test.go Loading commit data...
constants_unix.go Loading commit data...
constants_unix_nocgo.go Loading commit data...
context_headers.go Loading commit data...
doc.go Loading commit data...
endpoints.go Loading commit data...
errors.go Loading commit data...
handler.go Loading commit data...
http.go Loading commit data...
http_test.go Loading commit data...
inproc.go Loading commit data...
ipc.go Loading commit data...
ipc_js.go Loading commit data...
ipc_unix.go Loading commit data...
ipc_windows.go Loading commit data...
json.go Loading commit data...
metrics.go Loading commit data...
server.go Loading commit data...
server_test.go Loading commit data...
service.go Loading commit data...
stdio.go Loading commit data...
subscription.go Loading commit data...
subscription_test.go Loading commit data...
testservice_test.go Loading commit data...
types.go Loading commit data...
types_test.go Loading commit data...
websocket.go Loading commit data...
websocket_test.go Loading commit data...