Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient[T any](serverAddr string, newClientFunc func(conn grpc.ClientConnInterface) T, opts ...grpc.DialOption) (T, func() error, error)
NewClient will return 3 params is GRPCClient instance, CloseFunc, error. T must be particular GRPC Service Client interface. Like : ExampleServiceClient, HealthServiceClient... Example:
serverAddr := "localhost:10443"
client, closeFunc, err := NewClient(serverAddr, func(conn grpc.ClientConnInterface) examplev1.ExampleServiceClient { return examplev1.NewExampleServiceClient(conn) })
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.