Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
goSDN
Commits
bb343b26
Commit
bb343b26
authored
4 years ago
by
Malte Bauch
Browse files
Options
Downloads
Patches
Plain Diff
added command flags to goSDN-tview
parent
6cc58c2f
No related branches found
No related tags found
3 merge requests
!90
Develop
,
!70
Resolve "Add command-line flags to goSDN-tview"
,
!53
V.0.1.0 Codename Threadbare
Pipeline
#53115
passed
4 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/gosdn-tview/grpc/commands.go
+2
-2
2 additions, 2 deletions
cmd/gosdn-tview/grpc/commands.go
cmd/gosdn-tview/main.go
+11
-1
11 additions, 1 deletion
cmd/gosdn-tview/main.go
with
13 additions
and
3 deletions
cmd/gosdn-tview/grpc/commands.go
+
2
−
2
View file @
bb343b26
...
@@ -31,8 +31,8 @@ var CommandList = []command{
...
@@ -31,8 +31,8 @@ var CommandList = []command{
}
}
//Connect creates a new connection to the gRPC server
//Connect creates a new connection to the gRPC server
func
Connect
()
(
*
grpc
.
ClientConn
,
error
)
{
func
Connect
(
address
string
)
(
*
grpc
.
ClientConn
,
error
)
{
address
:=
"141.100.70.170:55066"
//
address := "141.100.70.170:55066"
return
grpc
.
Dial
(
address
,
grpc
.
WithInsecure
(),
grpc
.
WithTimeout
(
5
*
time
.
Second
),
grpc
.
WithBlock
())
return
grpc
.
Dial
(
address
,
grpc
.
WithInsecure
(),
grpc
.
WithTimeout
(
5
*
time
.
Second
),
grpc
.
WithBlock
())
}
}
...
...
This diff is collapsed.
Click to expand it.
cmd/gosdn-tview/main.go
+
11
−
1
View file @
bb343b26
package
main
package
main
import
(
import
(
"flag"
"strconv"
"strings"
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/app"
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/app"
grpc
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/grpc"
grpc
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/grpc"
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/views"
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/views"
...
@@ -8,7 +12,13 @@ import (
...
@@ -8,7 +12,13 @@ import (
)
)
func
main
()
{
func
main
()
{
conn
,
err
:=
grpc
.
Connect
()
addrIPv4
:=
flag
.
String
(
"addr"
,
"localhost"
,
"IPv4 server adress to connect to"
)
port
:=
flag
.
Int
(
"port"
,
55055
,
"Port of gRPC"
)
flag
.
Parse
()
addr
:=
strings
.
Join
([]
string
{
*
addrIPv4
,
strconv
.
Itoa
(
*
port
)},
":"
)
conn
,
err
:=
grpc
.
Connect
(
addr
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment