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
5fcea82f
Commit
5fcea82f
authored
4 years ago
by
Malte Bauch
Browse files
Options
Downloads
Patches
Plain Diff
formatting and changed from goimports to gofmt
parent
9b8d9e74
No related branches found
No related tags found
2 merge requests
!23
Resolve "CI/CD"
,
!18
Develop
Pipeline
#52088
failed
4 years ago
Stage: test
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.golangci.yml
+1
-1
1 addition, 1 deletion
.golangci.yml
database/database.go
+1
-1
1 addition, 1 deletion
database/database.go
gosdn-cli/gosdn-cli.go
+16
-18
16 additions, 18 deletions
gosdn-cli/gosdn-cli.go
restconf/util/unmarshal.go
+1
-1
1 addition, 1 deletion
restconf/util/unmarshal.go
with
19 additions
and
21 deletions
.golangci.yml
+
1
−
1
View file @
5fcea82f
...
@@ -9,7 +9,7 @@ linters-settings:
...
@@ -9,7 +9,7 @@ linters-settings:
linters
:
linters
:
disable-all
:
true
disable-all
:
true
enable
:
enable
:
-
go
imports
-
go
fmt
-
golint
-
golint
-
gocyclo
-
gocyclo
-
govet
-
govet
This diff is collapsed.
Click to expand it.
database/database.go
+
1
−
1
View file @
5fcea82f
...
@@ -105,7 +105,7 @@ func (d Database) StoreNodeEdgePoints(json string) {
...
@@ -105,7 +105,7 @@ func (d Database) StoreNodeEdgePoints(json string) {
}
}
func
(
d
Database
)
StoreConnections
(
json
string
){}
func
(
d
Database
)
StoreConnections
(
json
string
)
{}
//setNodeNodeEdgePointsRelation creates the database relations between "nodes" and "node edge points"
//setNodeNodeEdgePointsRelation creates the database relations between "nodes" and "node edge points"
func
setNodeNodeEdgePointsRelation
(
session
neo4j
.
Session
)
{
func
setNodeNodeEdgePointsRelation
(
session
neo4j
.
Session
)
{
...
...
This diff is collapsed.
Click to expand it.
gosdn-cli/gosdn-cli.go
+
16
−
18
View file @
5fcea82f
...
@@ -3,13 +3,13 @@ package main
...
@@ -3,13 +3,13 @@ package main
import
(
import
(
pb
"code.fbi.h-da.de/cocsn/gosdn/cliInterface"
pb
"code.fbi.h-da.de/cocsn/gosdn/cliInterface"
"context"
"context"
"flag"
"fmt"
"fmt"
"github.com/rivo/tview"
"github.com/rivo/tview"
"google.golang.org/grpc"
"google.golang.org/grpc"
"log"
"log"
"os"
"os"
"time"
"time"
"flag"
)
)
const
(
const
(
...
@@ -29,27 +29,27 @@ var (
...
@@ -29,27 +29,27 @@ var (
type
cliClientConfig
struct
{
type
cliClientConfig
struct
{
goSDNCLIAddr4
*
string
goSDNCLIAddr4
*
string
goSDNCLIPort4
*
int
goSDNCLIPort4
*
int
interactive
*
bool
interactive
*
bool
goSDNCommand
*
string
goSDNCommand
*
string
}
}
type
commandOptions
struct
{
type
commandOptions
struct
{
name
string
name
string
description
string
description
string
command
func
(
conn
*
grpc
.
ClientConn
)
()
command
func
(
conn
*
grpc
.
ClientConn
)
}
}
var
commandList
=
map
[
string
]
commandOptions
{
var
commandList
=
map
[
string
]
commandOptions
{
"hello"
:
{
"hello"
,
"test connection to goSDN controller"
,
goSDNSayHello
},
"hello"
:
{
"hello"
,
"test connection to goSDN controller"
,
goSDNSayHello
},
"shutdown"
:
{
"shutdown"
,
"request goSDN controller to shutdown"
,
goSDNShutdown
},
"shutdown"
:
{
"shutdown"
,
"request goSDN controller to shutdown"
,
goSDNShutdown
},
"testdb"
:
{
"testdb"
,
"test all database connections"
,
goSDNTestDB
},
"testdb"
:
{
"testdb"
,
"test all database connections"
,
goSDNTestDB
},
}
}
/*
/*
gosdn-cli allows to mode of operations:
gosdn-cli allows to mode of operations:
- interactive: text GUI to operate goSDN
- interactive: text GUI to operate goSDN
- non-interactive: basic CLI without text GUI
- non-interactive: basic CLI without text GUI
*/
*/
func
main
()
{
func
main
()
{
// This holds the basic configuration for gosdn-cli
// This holds the basic configuration for gosdn-cli
...
@@ -64,7 +64,7 @@ func main() {
...
@@ -64,7 +64,7 @@ func main() {
flag
.
Parse
()
flag
.
Parse
()
// Print complete command list and exit
// Print complete command list and exit
if
(
*
printCommandList
==
true
)
{
if
*
printCommandList
==
true
{
for
_
,
element
:=
range
commandList
{
for
_
,
element
:=
range
commandList
{
fmt
.
Println
(
element
.
name
+
"
\t
"
+
element
.
description
)
fmt
.
Println
(
element
.
name
+
"
\t
"
+
element
.
description
)
}
}
...
@@ -87,11 +87,11 @@ func main() {
...
@@ -87,11 +87,11 @@ func main() {
log
.
Println
((
"Connected to "
+
conn
.
Target
()))
log
.
Println
((
"Connected to "
+
conn
.
Target
()))
// Check for non-interactive or interactive mode
// Check for non-interactive or interactive mode
if
(
*
myConfiguration
.
interactive
==
false
)
{
if
*
myConfiguration
.
interactive
==
false
{
log
.
Println
(
"starting in non-interactive mode"
)
log
.
Println
(
"starting in non-interactive mode"
)
// Lookup command or die
// Lookup command or die
_
,
found
:=
commandList
[
*
myConfiguration
.
goSDNCommand
]
_
,
found
:=
commandList
[
*
myConfiguration
.
goSDNCommand
]
if
(
found
)
{
if
found
{
// Excecute desired command
// Excecute desired command
commandList
[
*
myConfiguration
.
goSDNCommand
]
.
command
(
conn
)
commandList
[
*
myConfiguration
.
goSDNCommand
]
.
command
(
conn
)
}
else
{
}
else
{
...
@@ -118,8 +118,7 @@ func main() {
...
@@ -118,8 +118,7 @@ func main() {
}
}
}
}
func
goSDNSayHello
(
conn
*
grpc
.
ClientConn
)
{
func
goSDNSayHello
(
conn
*
grpc
.
ClientConn
)
{
c
:=
pb
.
NewGreeterClient
(
conn
)
c
:=
pb
.
NewGreeterClient
(
conn
)
...
@@ -136,10 +135,9 @@ func goSDNSayHello (conn *grpc.ClientConn) {
...
@@ -136,10 +135,9 @@ func goSDNSayHello (conn *grpc.ClientConn) {
}
}
log
.
Printf
(
"Greeting: %s"
,
r
.
GetMessage
())
log
.
Printf
(
"Greeting: %s"
,
r
.
GetMessage
())
}
}
func
goSDNShutdown
(
conn
*
grpc
.
ClientConn
)
{
func
goSDNShutdown
(
conn
*
grpc
.
ClientConn
)
{
c
:=
pb
.
NewGreeterClient
(
conn
)
c
:=
pb
.
NewGreeterClient
(
conn
)
...
@@ -157,6 +155,6 @@ func goSDNShutdown (conn *grpc.ClientConn) {
...
@@ -157,6 +155,6 @@ func goSDNShutdown (conn *grpc.ClientConn) {
log
.
Printf
(
"Greeting: %s"
,
r
.
GetMessage
())
log
.
Printf
(
"Greeting: %s"
,
r
.
GetMessage
())
}
}
func
goSDNTestDB
(
conn
*
grpc
.
ClientConn
){
func
goSDNTestDB
(
conn
*
grpc
.
ClientConn
)
{
// TODO: fill with code
// TODO: fill with code
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
restconf/util/unmarshal.go
+
1
−
1
View file @
5fcea82f
...
@@ -9,7 +9,7 @@ type YANGConsumer struct {
...
@@ -9,7 +9,7 @@ type YANGConsumer struct {
Data
*
[]
byte
Data
*
[]
byte
}
}
func
(
yc
YANGConsumer
)
Consume
(
reader
io
.
Reader
,
_
interface
{})
error
{
func
(
yc
YANGConsumer
)
Consume
(
reader
io
.
Reader
,
_
interface
{})
error
{
var
err
error
=
nil
var
err
error
=
nil
*
yc
.
Data
,
err
=
ioutil
.
ReadAll
(
reader
)
*
yc
.
Data
,
err
=
ioutil
.
ReadAll
(
reader
)
return
err
return
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