An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 2.6% on proxy.golang.org
Top 1.5% dependent packages on proxy.golang.org
Top 0.9% dependent repos on proxy.golang.org
Top 4.8% forks on proxy.golang.org
Top 0.8% docker downloads on proxy.golang.org

proxy.golang.org : github.com/philippseith/signalr

Package signalr contains a SignalR client and a SignalR server. Both support the transport types Websockets and Server-Sent Events and the transfer formats Text (JSON) and Binary (MessagePack). The SignalR Protocol is a protocol for two-way RPC over any stream- or message-based transport. Either party in the connection may invoke procedures on the other party, and procedures can return zero or more results or an error. Typically, SignalR connections are HTTP-based, but it is dead simple to implement a signalr.Connection on any transport that supports io.Reader and io.Writer. A Client can be used in client side code to access server methods. From an existing connection, it can be created with NewClient(). A special case is NewHTTPClient(), which creates a Client from a server address and negotiates with the server which kind of connection (Websockets, Server-Sent Events) will be used. The object which will receive server callbacks is passed to NewClient() by using the WithReceiver option. After calling client.Start(), the client is ready to call server methods or to receive callbacks. A Server provides the public methods of a server side class over signalr to the client. Such a server side class is called a hub and must implement HubInterface. It is reasonable to derive your hubs from the Hub struct type, which already implements HubInterface. Servers for arbitrary connection types can be created with NewServer(). To serve a connection, call server.Serve(connection) in a goroutine. Serve ends when the connection is closed or the servers context is canceled. To serve a HTTP connection, use server.MapHTTP(), which connects the server with a path in an http.ServeMux. The server then automatically negotiates which kind of connection (Websockets, Server-Sent Events) will be used. The SignalR protocol constrains the signature of hub or receiver methods that can be used over SignalR. All methods with serializable types as parameters and return types are supported. Methods with multiple return values are not generally supported, but returning one or no value and an optional error is supported. Methods which return a single sending channel (<-chan), and optionally an error, are used to initiate callee side streaming. The caller will receive the contents of the channel as stream. When the returned channel is closed, the stream will be completed. Methods with one or multiple receiving channels (chan<-) as parameters are used as receivers for caller side streaming. The caller invokes this method and pushes one or multiple streams to the callee. The method should end when all channels are closed. A channel is closed by the server when the assigned stream is completed. The methods which return a channel are not supported. In most cases, the caller will be the client and the callee the server. But the vice versa case is also possible.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/philippseith/signalr
Keywords: golang , messagepack , realtime-web , server-sent-events , signalr , signalr-client , signalr-server , websocket
License: MIT
Latest release: about 2 months ago
First release: about 4 years ago
Namespace: github.com/philippseith
Dependent packages: 12
Dependent repositories: 36
Stars: 173 on GitHub
Forks: 49 on GitHub
Docker dependents: 5
Docker downloads: 363,298
See more repository details: repos.ecosyste.ms
Last synced: 2 days ago

    Loading...
    Readme
    Loading...