-
Notifications
You must be signed in to change notification settings - Fork 10
/
iptb.go
74 lines (62 loc) · 1.49 KB
/
iptb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package main
import (
"fmt"
"os"
cli "github.com/ipfs/iptb/cli"
testbed "github.com/ipfs/iptb/testbed"
browser "github.com/ipfs/iptb-plugins/browser"
docker "github.com/ipfs/iptb-plugins/docker"
local "github.com/ipfs/iptb-plugins/local"
localp2pd "github.com/ipfs/iptb-plugins/localp2pd"
)
func init() {
_, err := testbed.RegisterPlugin(testbed.IptbPlugin{
From: "<builtin>",
NewNode: local.NewNode,
GetAttrList: local.GetAttrList,
GetAttrDesc: local.GetAttrDesc,
PluginName: local.PluginName,
BuiltIn: true,
}, false)
if err != nil {
panic(err)
}
_, err = testbed.RegisterPlugin(testbed.IptbPlugin{
From: "<builtin>",
NewNode: localp2pd.NewNode,
GetAttrList: localp2pd.GetAttrList,
GetAttrDesc: localp2pd.GetAttrDesc,
PluginName: localp2pd.PluginName,
BuiltIn: true,
}, false)
if err != nil {
panic(err)
}
_, err = testbed.RegisterPlugin(testbed.IptbPlugin{
From: "<builtin>",
NewNode: docker.NewNode,
GetAttrList: docker.GetAttrList,
GetAttrDesc: docker.GetAttrDesc,
PluginName: docker.PluginName,
BuiltIn: true,
}, false)
if err != nil {
panic(err)
}
_, err = testbed.RegisterPlugin(testbed.IptbPlugin{
From: "<builtin>",
NewNode: browser.NewNode,
PluginName: browser.PluginName,
BuiltIn: true,
}, false)
if err != nil {
panic(err)
}
}
func main() {
cli := cli.NewCli()
if err := cli.Run(os.Args); err != nil {
fmt.Fprintf(cli.ErrWriter, "%s\n", err)
os.Exit(1)
}
}