mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Rename NewResourceClient funcs
This commit is contained in:
parent
36b3752490
commit
79d9969aa8
@ -545,9 +545,9 @@ func (s *service) running(ctx context.Context) error {
|
||||
|
||||
func newResourceClient(conn *grpc.ClientConn, cfg *setting.Cfg) (resource.ResourceStoreClient, error) {
|
||||
if cfg.StackID != "" {
|
||||
return resource.NewResourceClientCloud(conn, cfg)
|
||||
return resource.NewCloudResourceClient(conn, cfg)
|
||||
}
|
||||
return resource.NewResourceClientGRPC(conn)
|
||||
return resource.NewGRPCResourceClient(conn)
|
||||
}
|
||||
|
||||
func ensureKubeConfig(restConfig *clientrest.Config, dir string) error {
|
||||
|
@ -44,7 +44,7 @@ func NewLocalResourceClient(server ResourceStoreServer) ResourceStoreClient {
|
||||
return NewResourceStoreClient(grpchan.InterceptClientConn(channel, clientInt.UnaryClientInterceptor, clientInt.StreamClientInterceptor))
|
||||
}
|
||||
|
||||
func NewResourceClientGRPC(conn *grpc.ClientConn) (ResourceStoreClient, error) {
|
||||
func NewGRPCResourceClient(conn *grpc.ClientConn) (ResourceStoreClient, error) {
|
||||
// scenario: remote on-prem
|
||||
clientInt, err := authnlib.NewGrpcClientInterceptor(
|
||||
&authnlib.GrpcClientConfig{},
|
||||
@ -59,7 +59,7 @@ func NewResourceClientGRPC(conn *grpc.ClientConn) (ResourceStoreClient, error) {
|
||||
return NewResourceStoreClient(grpchan.InterceptClientConn(conn, clientInt.UnaryClientInterceptor, clientInt.StreamClientInterceptor)), nil
|
||||
}
|
||||
|
||||
func NewResourceClientCloud(conn *grpc.ClientConn, cfg *setting.Cfg) (ResourceStoreClient, error) {
|
||||
func NewCloudResourceClient(conn *grpc.ClientConn, cfg *setting.Cfg) (ResourceStoreClient, error) {
|
||||
// scenario: remote cloud
|
||||
grpcClientConfig := clientCfgMapping(grpcutils.ReadGrpcClientConfig(cfg))
|
||||
|
||||
|
@ -357,7 +357,7 @@ func TestClientServer(t *testing.T) {
|
||||
t.Run("Create a client", func(t *testing.T) {
|
||||
conn, err := grpc.NewClient(svc.GetAddress(), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
require.NoError(t, err)
|
||||
client, err = resource.NewResourceClientGRPC(conn)
|
||||
client, err = resource.NewGRPCResourceClient(conn)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user