Skip to content
Snippets Groups Projects
Commit e79254cc authored by Malte Bauch's avatar Malte Bauch
Browse files

fixed lint errors

parent b22bb1b6
Branches
Tags
3 merge requests!90Develop,!71Resolve "Stream logger-output to goSDN-tview via gRPC",!53V.0.1.0 Codename Threadbare
......@@ -35,6 +35,7 @@ func Connect(address string) (*grpc.ClientConn, error) {
return grpc.Dial(address, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second), grpc.WithBlock())
}
//GoSDNLogStream creates a continuous gRPC stream to recieve goSDN logs
func GoSDNLogStream(conn *grpc.ClientConn, clv *tview.TextView) error {
var streamError error
c := pb.NewGrpcCliClient(conn)
......
......@@ -20,7 +20,7 @@ import (
"google.golang.org/protobuf/types/known/emptypb"
)
type LogConnection struct {
type logConnection struct {
stream pb.GrpcCli_CreateLogStreamServer
id string
active bool
......@@ -31,7 +31,7 @@ type LogConnection struct {
type server struct {
pb.UnimplementedGrpcCliServer
core *Core
logConnections []*LogConnection
logConnections []*logConnection
}
var srv *server
......@@ -52,7 +52,7 @@ func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloRe
//GetLog creates a continuous stream between client and server to send goSDN logs
func (s *server) CreateLogStream(req *emptypb.Empty, stream pb.GrpcCli_CreateLogStreamServer) error {
conn := &LogConnection{
conn := &logConnection{
stream: stream,
active: true,
error: make(chan error),
......@@ -69,7 +69,7 @@ func (s *server) BroadcastLog(log *pb.LogReply) {
for _, conn := range s.logConnections {
wait.Add(1)
go func(conn *LogConnection) {
go func(conn *logConnection) {
defer wait.Done()
if conn.active {
err := conn.stream.Send(log)
......@@ -99,7 +99,7 @@ func (s *server) Shutdown(ctx context.Context, in *pb.ShutdownRequest) (*pb.Shut
func getCLIGoing(core *Core) {
var logConnections []*LogConnection
var logConnections []*logConnection
var logBuffer buf
log.Info("Starting: GetCLIGoing")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment