client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 12 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
	KeepAliveTime                int
	KeepAliveTimeout             int
	KeepAlivePermitWithoutStream bool
}

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