client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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