blob: a3e9f45ec90d0a5441fc26404114790759122adb [file] [log] [blame]
Matteo Scandolo4b077aa2021-02-16 17:33:37 -08001/*
Joey Armstrong14628cd2023-01-10 08:38:31 -05002 * Copyright 2018-2023 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandolo4b077aa2021-02-16 17:33:37 -08003
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package commands
18
19import (
20 pb "github.com/opencord/bbsim/api/bbsim"
21 "github.com/opencord/bbsim/internal/bbsimctl/config"
22 log "github.com/sirupsen/logrus"
23 "google.golang.org/grpc"
24)
25
26func connect() (pb.BBSimClient, *grpc.ClientConn) {
27 conn, err := grpc.Dial(config.GlobalConfig.Server, grpc.WithInsecure())
28
29 if err != nil {
30 log.Fatalf("did not connect: %v", err)
31 return nil, conn
32 }
33 return pb.NewBBSimClient(conn), conn
34}