client

package
v0.0.0-...-3481ce3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: MIT Imports: 13 Imported by: 2

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(opts ...Option) (*Client, error)

NewClient 创建客户端对象

func NewDefaultClient

func NewDefaultClient(opts ...Option) (*Client, error)

NewDefaultClient 创建默认客户端对象

func (*Client) Close

func (c *Client) Close()

Close 关闭连接 - 服务结束时

func (*Client) Dial

func (c *Client) Dial(clients ...NewGrpcClient) error

Dial 连接grpc服务端,并构造多客户端

type NewGrpcClient

type NewGrpcClient func(*grpc.ClientConn)

NewGrpcClient 用户生成客户端对象

type Option

type Option func(*Options)

Option 实例值设置

func ConnTimeout

func ConnTimeout(connTimeout time.Duration) Option

ConnTimeout 设置连接超时

func Middleware

func Middleware(middlewares ...middleware.Middleware) Option

Middleware 服务中间件

func Register

func Register(reg register.Register) Option

Register 服务注册中间件

func ServiceName

func ServiceName(serviceName string) Option

ServiceName 服务名

type Options

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

Options 注册相关参数

Jump to

Keyboard shortcuts

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