1 package api 2 3 import ( 4 pb "github.com/linkerd/linkerd2/viz/tap/gen/tap" 5 "google.golang.org/grpc" 6 "google.golang.org/grpc/credentials/insecure" 7 ) 8 9 // NewClient creates a client for the control-plane's Tap service. 10 func NewClient(addr string) (pb.TapClient, *grpc.ClientConn, error) { 11 conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) 12 if err != nil { 13 return nil, nil, err 14 } 15 return pb.NewTapClient(conn), conn, nil 16 } 17