dracarys

package module
v1.2.1 Latest Latest
Warning

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

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

README

Dracarys

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientOpts

func NewClientOpts(opts ...client.Option) *client.Options

NewClientOpts 创建client的配置.

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 NewClientWithOpts

func NewClientWithOpts(opts *client.Options) *Client

NewClientWithOpts 通过client的配置生成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) Invoke

func (c *Client) Invoke(ctx context.Context, req, rep interface{}, option ...client.Option) error

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