client

package
v2.0.0-...-5372cc7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

func NewBuilder(opts *Options) *Builder

func (*Builder) Build

func (b *Builder) Build(target string) (*grpc.ClientConn, error)

Build 构建连接

type Client

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

func NewClient

func NewClient(cc *grpc.ClientConn) *Client

func (*Client) Call

func (c *Client) Call(ctx context.Context, service, method string, args interface{}, reply interface{}, opts ...interface{}) error

Call 调用服务方法

func (*Client) Client

func (c *Client) Client() interface{}

Client 获取GRPC客户端

type Options

type Options struct {
	PoolSize   int
	CertFile   string
	ServerName string
	Discovery  registry.Discovery
	DialOpts   []grpc.DialOption
}

type Pool

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

func (*Pool) Get

func (p *Pool) Get() *grpc.ClientConn

Jump to

Keyboard shortcuts

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