Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialRPC ¶
func DialRPC(preference RPCPreference, rpc RPC, dialer Dialer) *rpc.Client
DialRPC navigates the RPC interface, to find the optimal version of the PRC to dial or attach to.
func SelectRPC ¶
func SelectRPC(preference RPCPreference, rpc RPC) string
SelectRPC selects an endpoint URL, based on preference. For more optimal dialing, use DialRPC.
Types ¶
type ClientRPC ¶
ClientRPC is an RPC extension interface, providing the option to attach in-process to a client, rather than dialing an endpoint.
type RPC ¶
type RPC interface {
RPC() string
}
RPC is an interface for an endpoint to provide flexibility. By default the RPC just returns an RPC endpoint string. But the RPC can implement one or more extension interfaces, to provide alternative ways of establishing a connection, or even a fully initialized client binding.
type RPCPreference ¶
type RPCPreference int
const ( PreferAnyRPC RPCPreference = iota PreferHttpRPC PreferWSRPC )
type RestHTTP ¶
type RestHTTP interface {
RestHTTP() string
}
RestHTTP is an interface for an endpoint to provide flexibility. By default the RestHTTP just returns an REST-ful HTTP endpoint string. But the RestHTTP can implement one or more extension interfaces, to provide alternative ways of establishing a connection, or even a fully initialized client binding.
type RestHTTPURL ¶
type RestHTTPURL string
RestHTTPURL is an HTTP endpoint URL string
func (RestHTTPURL) RestHTTP ¶
func (url RestHTTPURL) RestHTTP() string
type ServerRPC ¶
type ServerRPC struct { Fallback WsOrHttpRPC Server *rpc.Server }
ServerRPC is a very flexible RPC: it can attach in-process to a server, or select one of the fallback RPC methods.
type WsOrHttpRPC ¶
WsOrHttpRPC provides optionality between a websocket RPC endpoint and a HTTP RPC endpoint. The default is the websocket endpoint.
func (WsOrHttpRPC) HttpRPC ¶
func (r WsOrHttpRPC) HttpRPC() string
func (WsOrHttpRPC) RPC ¶
func (r WsOrHttpRPC) RPC() string
func (WsOrHttpRPC) WsRPC ¶
func (r WsOrHttpRPC) WsRPC() string