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
a222740d
Commit
a222740d
authored
4 years ago
by
Manuel Kieweg
Browse files
Options
Downloads
Patches
Plain Diff
refactored client slice to array
parent
260adbae
No related branches found
No related tags found
2 merge requests
!26
Resolve "restconf client to gosdn core"
,
!18
Develop
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nucleus/controller.go
+3
-2
3 additions, 2 deletions
nucleus/controller.go
nucleus/nucleus-core.go
+7
-1
7 additions, 1 deletion
nucleus/nucleus-core.go
with
10 additions
and
3 deletions
nucleus/controller.go
+
3
−
2
View file @
a222740d
...
@@ -19,7 +19,8 @@ type controllerConfig struct {
...
@@ -19,7 +19,8 @@ type controllerConfig struct {
}
}
type
Core
struct
{
type
Core
struct
{
clients
[]
interfaces
.
Client
//Assert type with clients[key].(*MCPClient)
clients
map
[
string
]
interfaces
.
Client
database
database
.
Database
database
database
.
Database
config
controllerConfig
config
controllerConfig
}
}
...
@@ -47,7 +48,7 @@ func (c *Core) Init(socket, configfile string) {
...
@@ -47,7 +48,7 @@ func (c *Core) Init(socket, configfile string) {
c
.
AttachDatabase
()
c
.
AttachDatabase
()
//TODO: Create client config/CLI adapter
//TODO: Create client config/CLI adapter
c
.
clients
=
append
(
c
.
clients
,
ciena
.
NewMCPClient
(
"141.100.70.170"
,
""
,
""
,
&
c
.
database
)
)
c
.
clients
[
"ciena-mcp"
]
=
ciena
.
NewMCPClient
(
"141.100.70.170"
,
""
,
""
,
&
c
.
database
)
}
}
func
(
c
*
Core
)
AttachDatabase
()
{
func
(
c
*
Core
)
AttachDatabase
()
{
...
...
This diff is collapsed.
Click to expand it.
nucleus/nucleus-core.go
+
7
−
1
View file @
a222740d
...
@@ -2,6 +2,8 @@ package nucleus
...
@@ -2,6 +2,8 @@ package nucleus
import
(
import
(
pb
"code.fbi.h-da.de/cocsn/gosdn/cliInterface"
pb
"code.fbi.h-da.de/cocsn/gosdn/cliInterface"
"code.fbi.h-da.de/cocsn/gosdn/database"
"code.fbi.h-da.de/cocsn/gosdn/nucleus/interfaces"
"context"
"context"
_
"github.com/mattn/go-sqlite3"
_
"github.com/mattn/go-sqlite3"
"google.golang.org/grpc"
"google.golang.org/grpc"
...
@@ -55,7 +57,11 @@ func StartUp(socket, filename string) {
...
@@ -55,7 +57,11 @@ func StartUp(socket, filename string) {
log
.
Println
(
"This is the network superintendent..."
)
log
.
Println
(
"This is the network superintendent..."
)
log
.
Println
(
"Starting my ducks"
)
log
.
Println
(
"Starting my ducks"
)
// Init the Core
// Init the Core
core
:=
Core
{}
core
:=
Core
{
clients
:
make
(
map
[
string
]
interfaces
.
Client
,
0
),
database
:
database
.
Database
{},
config
:
nil
,
}
core
.
Init
(
socket
,
filename
)
core
.
Init
(
socket
,
filename
)
// Start the GRCP CLI
// Start the GRCP CLI
go
getCLIGoing
(
&
core
)
go
getCLIGoing
(
&
core
)
...
...
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