rpc

package
v0.2.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client

func NewClient

func NewClient() *Client

NewClient

func (*Client) Call

func (c *Client) Call(serviceMethod string, args interface{}, reply interface{}) (*Client, error)

Call 调用

func (*Client) CallByMessage

func (c *Client) CallByMessage(message RpcMessage) (*Client, error)

CallByMessage

func (*Client) Close

func (c *Client) Close()

Close 关闭连接

func (*Client) Start

func (c *Client) Start() (*Client, error)

Start 启动

func (*Client) WithAddress

func (c *Client) WithAddress(addr ...string) (*Client, error)

WithAddress 设置地址

type RpcMessage

type RpcMessage struct {
	Method   string
	Args     interface{}
	Callback func(reply interface{})
}

RpcMessage

type Server

type Server struct {
}

Server

func NewServer

func NewServer() *Server

NewClient

func (*Server) Register

func (s *Server) Register(server interface{}) *Server

Register 注册

func (*Server) RegisterName

func (s *Server) RegisterName(name string, server interface{}) *Server

RegisterName 注册

func (*Server) Run

func (s *Server) Run(addr ...string) error

Run 启动服务

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL