package module
v1.2.102 Latest Latest

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

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


GRPC Client

The grpc client is a micro.Client compatible client.


The client makes use of the framework for the underlying communication mechanism.


Specify the client to your micro service

import (

func main() {
	service := micro.NewService(



Package grpc provides a gRPC client

Package grpc provides a gRPC options



This section is empty.


View Source
var (
	// DefaultPoolMaxStreams maximum streams on a connectioin
	// (20).
	DefaultPoolMaxStreams = 20

	// DefaultPoolMaxIdle maximum idle conns of a pool
	// (50).
	DefaultPoolMaxIdle = 50

	// DefaultMaxRecvMsgSize maximum message that client can receive
	// (4 MB).
	DefaultMaxRecvMsgSize = 1024 * 1024 * 4

	// DefaultMaxSendMsgSize maximum message that client can send
	// (4 MB).
	DefaultMaxSendMsgSize = 1024 * 1024 * 4


func AuthTLS

func AuthTLS(t *tls.Config) client.Option

AuthTLS should be used to setup a secure authentication using TLS.

func CallOptions

func CallOptions(opts ...grpc.CallOption) client.CallOption

CallOptions to be used to configure gRPC call options.

func Codec

func Codec(contentType string, c encoding.Codec) client.Option

gRPC Codec to be used to encode/decode requests for a given content type.

func DialOptions

func DialOptions(opts ...grpc.DialOption) client.CallOption

DialOptions to be used to configure gRPC dial options.

func MaxRecvMsgSize

func MaxRecvMsgSize(s int) client.Option

MaxRecvMsgSize set the maximum size of message that client can receive.

func MaxSendMsgSize

func MaxSendMsgSize(s int) client.Option

MaxSendMsgSize set the maximum size of message that client can send.

func NewClient

func NewClient(opts ...client.Option) client.Client

func PoolMaxIdle

func PoolMaxIdle(d int) client.Option

maximum idle conns of a pool.

func PoolMaxStreams

func PoolMaxStreams(n int) client.Option

maximum streams on a connectioin.

func UseNumber

func UseNumber()

UseNumber fix unmarshal Number(8234567890123456789) to interface(8.234567890123457e+18).


This section is empty.

Jump to

Keyboard shortcuts

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