Documentation
¶
Index ¶
- Variables
- type Call
- type Client
- func (c *Client) AsyncCall(service string, method string, args interface{}, reply interface{}) chan *Call
- func (c *Client) Call(service string, method string, args interface{}, reply interface{}) error
- func (client *Client) Close()
- func (client *Client) Go(service string, method string, args any, reply any, done chan *Call) *Call
- type Server
- type StatusType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShutdown = errors.New("connection is shut down")
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct { Service string // The name of the service to call. Method string // The name of the method to call. Args any // The argument to the function (*struct). Reply any // The reply from the function (*struct). Error error // After completion, the error status. Done chan *Call // Receives *Call when Go is complete. }
Call represents an active RPC.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client rpc client based on net/tcp implementation
func NewClient ¶
func NewClient(opts options.ClientOptions) *Client
NewClient Create a new rpc client
func (*Client) AsyncCall ¶
func (c *Client) AsyncCall(service string, method string, args interface{}, reply interface{}) chan *Call
AsyncCall asynchronously calls the rpc function and returns a channel
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts options.ServerOptions) *Server
func (*Server) RegisterName ¶
RegisterName register the rpc function with the specified name
type StatusType ¶
Click to show internal directories.
Click to hide internal directories.