client

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DailTimeout = 3 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(c RpcClientConf, f func(*grpc.ClientConn) interface{}, opts ...Option) *Client

type Option

type Option func(options *Options)

func WithBuilder

func WithBuilder(builder resolver.Builder) Option

func WithDebug

func WithDebug() Option

func WithMiddleware

func WithMiddleware(interceptor grpc.UnaryClientInterceptor) Option

func WithProxy

func WithProxy(addrs ...string) Option

WithProxy 创建客户端的时候在metadata指定需要代理的grpc服务的应用域名和监听端口,即可在本地连接到kae上的grpc服务

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type Options

type Options struct {
	Timeout     time.Duration
	DialOptions []grpc.DialOption
	Builder     resolver.Builder
	Debug       bool
	ProxyAddr   string
	// contains filtered or unexported fields
}

type RpcClientConf

type RpcClientConf struct {
	Addr        string `yaml:"addr"`
	ServiceName string `yaml:"service_name"`
}

Jump to

Keyboard shortcuts

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