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
!75
Draft: Resolve "Create interfaces for internal data structure"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Resolve "Create interfaces for internal data structure"
60-create-interfaces-for-internal-data-structure
into
develop
Overview
1
Commits
1
Pipelines
9
Changes
1
Closed
Ghost User
requested to merge
60-create-interfaces-for-internal-data-structure
into
develop
4 years ago
Overview
1
Commits
1
Pipelines
9
Changes
1
Expand
Closes
#60 (closed)
0
0
Merge request reports
Compare
develop
version 5
5f76f7d8
4 years ago
version 4
5f76f7d8
4 years ago
version 3
bc777bcc
4 years ago
version 2
6dc97f27
4 years ago
version 1
91f9af6e
4 years ago
develop (base)
and
latest version
latest version
5f76f7d8
1 commit,
4 years ago
version 5
5f76f7d8
1 commit,
4 years ago
version 4
5f76f7d8
5 commits,
4 years ago
version 3
bc777bcc
4 commits,
4 years ago
version 2
6dc97f27
2 commits,
4 years ago
version 1
91f9af6e
1 commit,
4 years ago
1 file
+
10
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
nucleus/sbi-general.go
+
10
−
7
Options
@@ -6,11 +6,12 @@ import (
"plugin"
)
type
SBIGreeter
interface
{
SBIHello
()
type
SBIInterface
interface
{
Hello
()
string
AddClient
()
}
func
SBILoader
()
{
func
SBILoader
()
error
{
modPath
:=
"/Users/mls/go/src/code.fbi.h-da.de/cocsn/byowsbi/byowsbi.o"
// open the so file that contains the SBI-plugin as step before loading the symbols
@@ -21,21 +22,23 @@ func SBILoader () {
}
// loading the symbols
sbiModule
,
err
:=
plug
.
Lookup
(
"SBI
Greeter
"
)
sbiModule
,
err
:=
plug
.
Lookup
(
"SBI
Interface
"
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
os
.
Exit
(
1
)
}
// Assert the loaded symbol
var
sbi
greeter
SBIGreeter
sbi
greeter
,
ok
:=
sbiModule
.
(
SBI
Greeter
)
var
sbi
SBIInterface
sbi
,
ok
:=
sbiModule
.
(
SBI
Interface
)
if
!
ok
{
fmt
.
Println
(
"unexpected type from module symbol"
)
fmt
.
Println
(
ok
)
os
.
Exit
(
1
)
}
// use me!
sbigreeter
.
SBIHello
()
fmt
.
Print
(
sbi
.
Hello
())
sbi
.
AddClient
()
}
Loading