-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.go
60 lines (50 loc) · 1.25 KB
/
types.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
/*
* Copyright (c) 2021-present unTill Pro, Ltd.
*/
package ibusmem
import (
"context"
"time"
ibus "github.com/untillpro/airs-ibus"
)
type bus struct {
requestHandler func(requestCtx context.Context, sender interface{}, request ibus.Request)
timerResponse func(d time.Duration) <-chan time.Time
timerSection func(d time.Duration) <-chan time.Time
timerElement func(d time.Duration) <-chan time.Time
}
type channelSender struct {
c chan interface{}
timeout time.Duration
clientCtx context.Context
}
type resultSenderClosable struct {
currentSection ibus.ISection
sections chan ibus.ISection
elements chan element
err *error
timeout time.Duration
clientCtx context.Context // closed if client is e.g. disconnected
timerSection func(d time.Duration) <-chan time.Time
timerElement func(d time.Duration) <-chan time.Time
}
type arraySection struct {
sectionType string
path []string
elems chan element
}
type mapSection struct {
sectionType string
path []string
elems chan element
}
type objectSection struct {
sectionType string
path []string
elements chan element
elementReceived bool
}
type element struct {
name string
value []byte
}