Documentation ¶
Overview ¶
Package grpc implements gRPC clients. Package grpc also contains implementations for gRPC Web and gRPC reflection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(addr, serverName string, useReflection, useTLS bool, cacert, cert, certKey string) (entity.GRPCClient, error)
NewClient creates a new gRPC client. It dials to the server specified by addr. addr format is the same as the first argument of grpc.Dial. If serverName is not empty, it overrides the gRPC server name used to verify the hostname on the returned certificates. If useReflection is true, the gRPC client enables gRPC reflection. If useTLS is true, the gRPC client establishes a secure connection with the server.
The set of cert and certKey enables mutual authentication if useTLS is enabled. If one of it is not found, NewClient returns entity.ErrMutualAuthParamsAreNotEnough. If useTLS is false, cacert, cert and certKey are ignored.
func NewWebClient ¶
func NewWebClient(addr string, builder port.DynamicBuilder, useReflection, useTLS bool, cacert, cert, certKey string) entity.GRPCClient
Types ¶
This section is empty.