Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingParts = errors.Errorf("need more parts")
Functions ¶
func GenerateRandomID ¶
Types ¶
type QueryResponse ¶
type QueryResponse struct {
Message []byte `json:"message"`
}
type Response ¶
type Response interface { // Callback calls success or error function if/when the // response is received. Meant to be very similar to Promise/async // found in other languages. // RPC will call respFn 3 times: sent, round finished, and // response received. Callback(respFn func(response []byte), errFn func(err error)) Response // Wait waits until the response is complete returns the final // response bytes Wait() []byte }
Response interface for RPC responses from the Send function. Provides for the ability to call a callback on error or success or to listen on the channels directly.
type RoundResults ¶
type SentMessage ¶
type Server ¶
type Server interface { // Start listening on the server's cMix Identity Start() // Stop listening on the server's cMix Identity // Note: if you want to stop all network traffic, do // so with the cMix network client. Stop() // SetCallback allows you to change the callback after // initialization. This must be called before starting // the server. SetCallback(cbFn func(id *id.ID, request []byte) []byte) }
Server is the interface for the RPC server, users should add a callback then start listening for RPC requests.
Click to show internal directories.
Click to hide internal directories.