-
Notifications
You must be signed in to change notification settings - Fork 0
/
module.go
45 lines (37 loc) · 831 Bytes
/
module.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
package k6
import (
"go.k6.io/k6/js/modules"
_ "storj.io/storj/shared/dbutil/cockroachutil"
)
func init() {
modules.Register("k6/x/stbb", New())
}
type (
RootModule struct{}
ModuleInstance struct {
vu modules.VU
}
)
var (
_ modules.Instance = &ModuleInstance{}
_ modules.Module = &RootModule{}
)
func New() *RootModule {
return &RootModule{}
}
func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance {
return &ModuleInstance{
vu: vu,
}
}
// Exports implements the modules.Instance interface and returns the exported types for the JS module.
func (mi *ModuleInstance) Exports() modules.Exports {
return modules.Exports{
Default: MetainfoTest,
Named: map[string]interface{}{
"MetainfoTest": MetainfoTest,
"UplinkTest": UplinkTest,
"BeginObjectRPC": NewBeginObject,
},
}
}