Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
3453f0eb
Unverified
提交
3453f0eb
authored
9月 24, 2019
作者:
Steven Allen
提交者:
GitHub
9月 24, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6672 from MichaelMure/plugin-tracer-close
plugins: support Close() for Tracer plugins as well
上级
e921121b
72026b89
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
8 行增加
和
4 行删除
+8
-4
daemon.go
plugin/daemon.go
+0
-1
loader.go
plugin/loader/loader.go
+3
-2
plugin.go
plugin/plugin.go
+4
-1
tracer.go
plugin/tracer.go
+1
-0
没有找到文件。
plugin/daemon.go
浏览文件 @
3453f0eb
...
...
@@ -10,5 +10,4 @@ type PluginDaemon interface {
Plugin
Start
(
coreiface
.
CoreAPI
)
error
Close
()
error
}
plugin/loader/loader.go
浏览文件 @
3453f0eb
...
...
@@ -2,6 +2,7 @@ package loader
import
(
"fmt"
"io"
"os"
"path/filepath"
"strings"
...
...
@@ -266,8 +267,8 @@ func (loader *PluginLoader) Close() error {
started
:=
loader
.
started
loader
.
started
=
nil
for
_
,
pl
:=
range
started
{
if
pl
,
ok
:=
pl
.
(
plugin
.
PluginDaemon
);
ok
{
err
:=
pl
.
Close
()
if
closer
,
ok
:=
pl
.
(
io
.
Closer
);
ok
{
err
:=
closer
.
Close
()
if
err
!=
nil
{
errs
=
append
(
errs
,
fmt
.
Sprintf
(
"error closing plugin %s: %s"
,
...
...
plugin/plugin.go
浏览文件 @
3453f0eb
...
...
@@ -9,8 +9,11 @@ type Environment struct {
Config
interface
{}
}
// Plugin is base interface for all kinds of go-ipfs plugins
// Plugin is
the
base interface for all kinds of go-ipfs plugins
// It will be included in interfaces of different Plugins
//
// Optionally, Plugins can implement io.Closer if they want to
// have a termination step when unloading.
type
Plugin
interface
{
// Name should return unique name of the plugin
Name
()
string
...
...
plugin/tracer.go
浏览文件 @
3453f0eb
...
...
@@ -7,5 +7,6 @@ import (
// PluginTracer is an interface that can be implemented to add a tracer
type
PluginTracer
interface
{
Plugin
InitTracer
()
(
opentracing
.
Tracer
,
error
)
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论