dracarys

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 7 Imported by: 0

README

Dracarys

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(opts ...server.Option) *server.Server

NewServer 创建server端,用于注册service以及监听.

Types

type Client

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

func NewClient

func NewClient(opts ...client.Option) *Client

func (*Client) Call

func (c *Client) Call(methodName string, req ...interface{}) (interface{}, error)

Call 通过MethodName定位请求到具体的req.

func (*Client) CallWithReturnValue

func (c *Client) CallWithReturnValue(methodName string, rep interface{}, req ...interface{}) error

CallWithReturnValue 将返回值传入进行调用,可以直接解析出返回值,而不需要再进行类型断言. rep 可以为任意形式参数,并不局限于结构体.

func (*Client) Method

func (c *Client) Method(name string) Method

Method 获取具体Method.

func (*Client) Service

func (c *Client) Service(name string)

func (*Client) ServiceAndMethod

func (c *Client) ServiceAndMethod(name string) (Method, error)

ServiceAndMethod 通过service和method查询函数.

type Method

type Method func(...interface{}) (interface{}, error)

Directories

Path Synopsis
client client端,主要包含client端调用的核心内容.
client client端,主要包含client端调用的核心内容.
example
pool

Jump to

Keyboard shortcuts

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