Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
d83e07ea
Unverified
Commit
d83e07ea
authored
Feb 10, 2020
by
Oli Evans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: minimal plugin works
License: MIT Signed-off-by:
Oli Evans
<
oli@tableflip.io
>
parent
45efea8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
plugin/loader/preload.go
plugin/loader/preload.go
+2
-0
plugin/loader/preload_list
plugin/loader/preload_list
+1
-0
plugin/plugins/peeridlog/peeridlog.go
plugin/plugins/peeridlog/peeridlog.go
+44
-0
No files found.
plugin/loader/preload.go
View file @
d83e07ea
...
...
@@ -5,6 +5,7 @@ import (
pluginflatfs
"github.com/ipfs/go-ipfs/plugin/plugins/flatfs"
pluginipldgit
"github.com/ipfs/go-ipfs/plugin/plugins/git"
pluginlevelds
"github.com/ipfs/go-ipfs/plugin/plugins/levelds"
pluginpeeridlog
"github.com/ipfs/go-ipfs/plugin/plugins/peeridlog"
)
// DO NOT EDIT THIS FILE
...
...
@@ -16,4 +17,5 @@ func init() {
Preload
(
pluginbadgerds
.
Plugins
...
)
Preload
(
pluginflatfs
.
Plugins
...
)
Preload
(
pluginlevelds
.
Plugins
...
)
Preload
(
pluginpeeridlog
.
Plugins
...
)
}
plugin/loader/preload_list
View file @
d83e07ea
...
...
@@ -8,3 +8,4 @@ ipldgit github.com/ipfs/go-ipfs/plugin/plugins/git *
badgerds github.com/ipfs/go-ipfs/plugin/plugins/badgerds *
flatfs github.com/ipfs/go-ipfs/plugin/plugins/flatfs *
levelds github.com/ipfs/go-ipfs/plugin/plugins/levelds *
peeridlog github.com/ipfs/go-ipfs/plugin/plugins/peeridlog *
plugin/plugins/peeridlog/peeridlog.go
0 → 100644
View file @
d83e07ea
package
peeridlog
import
(
"fmt"
core
"github.com/ipfs/go-ipfs/core"
plugin
"github.com/ipfs/go-ipfs/plugin"
)
// Plugins is exported list of plugins that will be loaded
var
Plugins
=
[]
plugin
.
Plugin
{
&
peerIDLogPlugin
{},
}
// Log all the PeerIDs we connect to.
type
peerIDLogPlugin
struct
{}
var
_
plugin
.
PluginDaemonInternal
=
(
*
peerIDLogPlugin
)(
nil
)
// Name returns the plugin's name, satisfying the plugin.Plugin interface.
func
(
*
peerIDLogPlugin
)
Name
()
string
{
return
"peeridlog"
}
// Version returns the plugin's version, satisfying the plugin.Plugin interface.
func
(
*
peerIDLogPlugin
)
Version
()
string
{
return
"0.1.0"
}
// Init initializes plugin, satisfying the plugin.Plugin interface. Put any
// initialization logic here.
func
(
*
peerIDLogPlugin
)
Init
(
*
plugin
.
Environment
)
error
{
return
nil
}
func
(
*
peerIDLogPlugin
)
Start
(
*
core
.
IpfsNode
)
error
{
fmt
.
Println
(
"peerIDLogPlugin HELLO!"
)
return
nil
}
func
(
*
peerIDLogPlugin
)
Close
()
error
{
fmt
.
Println
(
"peerIDLogPlugin GOODBYE!"
)
return
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment