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
5805b110
Commit
5805b110
authored
2 years ago
by
Malte Bauch
Committed by
Malte Bauch
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add path and controller flags
parent
5008a952
No related branches found
No related tags found
1 merge request
!384
Basic interface monitoring application
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+4
-1
4 additions, 1 deletion
Makefile
applications/basic-interface-monitoring/http.go
+1
-1
1 addition, 1 deletion
applications/basic-interface-monitoring/http.go
applications/basic-interface-monitoring/main.go
+11
-2
11 additions, 2 deletions
applications/basic-interface-monitoring/main.go
with
16 additions
and
4 deletions
Makefile
+
4
−
1
View file @
5805b110
...
...
@@ -56,7 +56,7 @@ generate-csbi-yang-models: install-tools
../../
$(
TOOLS_DIR
)
/go-ygot-generator-generator config.yaml gostructs.go
&&
\
go generate
build
:
pre build-gosdn build-gosdnc build-orchestrator build-venv-manager build-arista-routing-engine-app build-hostname-checker-app
build
:
pre build-gosdn build-gosdnc build-orchestrator build-venv-manager build-arista-routing-engine-app build-hostname-checker-app
build-basic-interface-monitoring-app
build-gosdn
:
pre
$(
GOBUILD
)
-trimpath
-o
$(
BUILD_ARTIFACTS_PATH
)
/gosdn ./controller/cmd/gosdn
...
...
@@ -76,6 +76,9 @@ build-arista-routing-engine-app: pre
build-hostname-checker-app
:
pre
$(
GOBUILD
)
-trimpath
-o
$(
BUILD_ARTIFACTS_PATH
)
/hostname-checker ./applications/hostname-checker
build-basic-interface-monitoring-app
:
pre
$(
GOBUILD
)
-trimpath
-o
$(
BUILD_ARTIFACTS_PATH
)
/basic-interface-monitoring ./applications/basic-interface-monitoring
containerize-all
:
containerize-gosdn containerize-gosdnc containerize-orchestrator containerize-target
containerize-gosdn
:
...
...
This diff is collapsed.
Click to expand it.
applications/basic-interface-monitoring/http.go
+
1
−
1
View file @
5805b110
...
...
@@ -12,7 +12,7 @@ var clientChannels = make(map[chan []byte]bool)
// StartHTTPServer starts the HTTP server to provide the monitoring page.
func
StartHTTPServer
()
error
{
http
.
HandleFunc
(
"/"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
http
.
ServeFile
(
w
,
r
,
"webpage/index.html"
)
http
.
ServeFile
(
w
,
r
,
indexPath
)
})
http
.
HandleFunc
(
"/sse"
,
sseHandler
)
...
...
This diff is collapsed.
Click to expand it.
applications/basic-interface-monitoring/main.go
+
11
−
2
View file @
5805b110
package
main
import
(
"flag"
"os"
"code.fbi.h-da.de/danet/gosdn/application-framework/event"
...
...
@@ -8,8 +9,16 @@ import (
"github.com/sirupsen/logrus"
)
var
controllerAddress
string
var
indexPath
string
func
main
()
{
queueCredentials
,
err
:=
registration
.
Register
(
"localhost:55055"
,
"basic-interface-monitoring"
,
"SecurePresharedToken"
)
flag
.
StringVar
(
&
indexPath
,
"path"
,
"webpage/index.html"
,
"path to the webpage index.html file"
)
flag
.
StringVar
(
&
controllerAddress
,
"controller-address"
,
"localhost:55055"
,
"the address to the controller"
)
flag
.
Parse
()
queueCredentials
,
err
:=
registration
.
Register
(
controllerAddress
,
"basic-interface-monitoring"
,
"SecurePresharedToken"
)
if
err
!=
nil
{
logrus
.
Errorf
(
"failed to register application on control plane. %v"
,
err
)
os
.
Exit
(
1
)
...
...
@@ -29,5 +38,5 @@ func main() {
stopChannel
:
make
(
chan
os
.
Signal
,
1
),
}
app
.
Run
(
"localhost:55055"
)
app
.
Run
(
controllerAddress
)
}
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