grpc

package
v0.0.0-...-037b315 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// KeepAliveTime is the duration of time after which if the client doesn't see
	// any activity it pings the server to see if the transport is still alive.
	KeepAliveTime = time.Duration(10) * time.Second

	// KeepAliveTimeout is the duration of time for which the client waits after having
	// pinged for keepalive check and if no activity is seen even after that the connection
	// is closed.
	KeepAliveTimeout = time.Duration(3) * time.Second
)

Variables

This section is empty.

Functions

func GetConn

func GetConn(ctx context.Context, target, addr string) (*grpc.ClientConn, error)

GetConn 根据target获取conn,target为srv名字, 类似 gamesrv, addr为地址,类似 grpc://192.168.15.117:33308,addr可以为空

func Init

func Init(dis registry.Discovery)

func New

func New(opts ...clientOption) arpc.Client

func WithDiscovery

func WithDiscovery(dis registry.Discovery) clientOption

Types

This section is empty.

Jump to

Keyboard shortcuts

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