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
Merge requests
!138
Develop
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Develop
develop
into
master
Overview
0
Commits
196
Pipelines
446
Changes
3
Closed
Ghost User
requested to merge
develop
into
master
4 years ago
Overview
0
Commits
196
Pipelines
446
Changes
3
Expand
0
0
Merge request reports
Viewing commit
9cca50b3
Show latest version
3 files
+
13
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
9cca50b3
golint --fix
· 9cca50b3
Manuel Kieweg
authored
3 years ago
nucleus/device.go
+
10
−
1
Options
@@ -3,9 +3,9 @@ package nucleus
import
(
tpb
"code.fbi.h-da.de/cocsn/api/go/gosdn/transport"
"github.com/docker/docker/pkg/namesgenerator"
"github.com/golang/protobuf/proto"
"github.com/google/uuid"
"github.com/openconfig/ygot/ygot"
"google.golang.org/protobuf/proto"
)
// Device represents an Orchestrated Network Device (OND) which is managed by
@@ -21,6 +21,7 @@ type Device interface {
isDevice
()
}
// CommonDevice represents an OND
type
CommonDevice
struct
{
// UUID represents the Devices UUID
UUID
uuid
.
UUID
@@ -63,34 +64,42 @@ func (d *CommonDevice) ID() uuid.UUID {
return
d
.
UUID
}
// Model returns the ygot representation of the Device
func
(
d
*
CommonDevice
)
Model
()
ygot
.
GoStruct
{
return
d
.
GoStruct
}
// Transport returns the Transport of the device
func
(
d
*
CommonDevice
)
Transport
()
Transport
{
return
d
.
transport
}
// Name returns the name of the device
func
(
d
*
CommonDevice
)
Name
()
string
{
return
d
.
name
}
// SBI returns the sbi of the Device
func
(
d
*
CommonDevice
)
SBI
()
SouthboundInterface
{
return
d
.
sbi
}
// SetTransport sets the Device's Transport
func
(
d
*
CommonDevice
)
SetTransport
(
t
Transport
)
{
d
.
transport
=
t
}
// SetName sets the Device's name
func
(
d
*
CommonDevice
)
SetName
(
n
string
)
{
d
.
name
=
n
}
// SetSBI sets the Device's SBI
func
(
d
*
CommonDevice
)
SetSBI
(
sbi
SouthboundInterface
)
{
d
.
sbi
=
sbi
}
// ProcessResponse processes a response for the Device
func
(
d
*
CommonDevice
)
ProcessResponse
(
resp
proto
.
Message
)
error
{
return
d
.
transport
.
ProcessResponse
(
resp
,
d
.
GoStruct
,
d
.
sbi
.
Schema
())
}
Loading