/
chcollectorcr.go
59 lines (53 loc) · 1.32 KB
/
chcollectorcr.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
package hlf
import (
"context"
"github.com/anoideaopen/cartridge/manager"
"github.com/anoideaopen/robot/dto/parserdto"
)
type ChCollectorCreator func(ctx context.Context,
dataReady chan<- struct{},
srcChName string, startFrom uint64) (*chCollector, error)
func NewChCollectorCreatorWithCryptoMgr(
dstChName,
connectionProfile, userName, orgName string,
txPrefixes parserdto.TxPrefixes,
cryptoManager manager.Manager,
bufSize uint,
) ChCollectorCreator {
return newChCollectorCreator(dstChName,
connectionProfile,
userName, orgName,
txPrefixes,
cryptoManager,
bufSize)
}
func NewChCollectorCreator(
dstChName, connectionProfile,
userName, orgName string,
txPrefixes parserdto.TxPrefixes,
bufSize uint,
) ChCollectorCreator {
return newChCollectorCreator(dstChName,
connectionProfile,
userName, orgName,
txPrefixes,
nil,
bufSize)
}
func newChCollectorCreator(
dstChName,
connectionProfile,
userName, orgName string,
txPrefixes parserdto.TxPrefixes,
cryptoManager manager.Manager,
bufSize uint,
) ChCollectorCreator {
return func(ctx context.Context, dataReady chan<- struct{}, srcChName string, startFrom uint64) (*chCollector, error) {
return createChCollector(ctx,
dstChName, srcChName,
dataReady, startFrom, bufSize,
connectionProfile, userName, orgName,
txPrefixes,
cryptoManager)
}
}