generated from snivilised/astrolib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
traverse-api.go
167 lines (147 loc) Β· 4.75 KB
/
traverse-api.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
package tv
import (
"time"
"github.com/snivilised/traverse/core"
"github.com/snivilised/traverse/enums"
"github.com/snivilised/traverse/internal/feat/refine"
"github.com/snivilised/traverse/nfs"
"github.com/snivilised/traverse/pref"
)
// π package: traverse is the front line user facing interface to this module. It sits
// on the top of the code stack and is allowed to use anything, but nothing
// else can depend on definitions here, except unit tests.
// Director
type (
Director interface {
// Extent represents the magnitude of the traversal; ie we can
// perform a full Prime run, or Resume from a previously
// cancelled run.
//
// I wonder if this could be replaced by Prime/Resume, to simplify
//
Extent(bs *Builders) core.Navigator
}
director func(bs *Builders) core.Navigator
)
func (fn director) Extent(bs *Builders) core.Navigator {
return fn(bs)
}
// NavigatorFactory
type NavigatorFactory interface {
// Configure is a factory function that creates a navigator.
// We don't return an error here as that would make using the factory
// awkward. Instead, if there is an error during the build process,
// we return a fake navigator that when invoked immediately returns
// a traverse error indicating the build issue.
//
Configure() Director
}
type (
// π core
Node = core.Node
Client = core.Client
// π enums
Subscription = enums.Subscription
ResumeStrategy = enums.ResumeStrategy
// π refine
BaseSampleFilter = refine.SampleFilter
// π nfs
FileSystems = nfs.FileSystems
// π pref
Option = pref.Option
Options = pref.Options
Using = pref.Using
Was = pref.Was
)
const (
OutputChSize = 10
CheckCloseInterval = time.Second / 10
TimeoutOnSend = time.Second * 2
// π enum: ResumeStrategy
ResumeStrategySpawn = enums.ResumeStrategySpawn
ResumeStrategyFastward = enums.ResumeStrategyFastward
// π enum:Subscribe
SubscribeFiles = enums.SubscribeFiles
SubscribeFolders = enums.SubscribeFolders
SubscribeFoldersWithFiles = enums.SubscribeFoldersWithFiles
SubscribeUniversal = enums.SubscribeUniversal
)
var (
// π nfs
NewNativeFS = nfs.NewNativeFS
NewQueryStatusFS = nfs.NewQueryStatusFS
// π refine
NewSampleFilter = refine.NewSampleFilter
// π pref
IfOption = pref.IfOption
IfOptionF = pref.IfOptionF
WithCPU = pref.WithCPU
WithDepth = pref.WithDepth
WithFaultHandler = pref.WithFaultHandler
WithFilter = pref.WithFilter
WithHibernationWake = pref.WithHibernationWake
WithHibernationSleep = pref.WithHibernationSleep
WithHibernationBehaviour = pref.WithHibernationBehaviour
WithHookQueryStatus = pref.WithHookQueryStatus
WithHookReadDirectory = pref.WithHookReadDirectory
WithHookSort = pref.WithHookSort
WithHookCaseSensitiveSort = pref.WithHookCaseSensitiveSort
WithHookFileSubPath = pref.WithHookFileSubPath
WithHookFolderSubPath = pref.WithHookFolderSubPath
WithNavigationBehaviours = pref.WithNavigationBehaviours
WithOnAscend = pref.WithOnAscend
WithOnBegin = pref.WithOnBegin
WithOnDescend = pref.WithOnDescend
WithOnEnd = pref.WithOnEnd
WithOnStart = pref.WithOnStart
WithOnStop = pref.WithOnStop
WithPanicHandler = pref.WithPanicHandler
WithNoRecurse = pref.WithNoRecurse
WithNoW = pref.WithNoW
WithSampling = pref.WithSampling
WithSkipHandler = pref.WithSkipHandler
WithSortBehaviour = pref.WithSortBehaviour
WithSubPathBehaviour = pref.WithSubPathBehaviour
)
// sub package description:
//
// This high level list assumes everything can use core and enums; dependencies
// can only point downwards. NB: These restrictions do not apply to the unit tests;
// eg, "cycle_test" defines tests that are dependent on "pref", but "cycle" is prohibited
// from using "pref".
// ============================================================================
// π user interface layer
// traverse: [everything]
// ---
//
// π feature layer
// resume: ["pref"]
// sampling: ["refine"]
// hiber: ["refine", "services"]
// refine: []
//
// π central layer
// kernel: []
// types: [measure, pref, override]
// override: [tapable], !("types")
// ---
//
// π support layer
// pref: ["cycle", "services", "persist(to-be-confirmed)"] actually, persist should be part of pref
// persist: []
// services: []
// ---
//
// π intermediary layer
// cycle: [], !("pref")
// ---
//
// π platform layer
// tapable: [core]
// core: []
// enums: [none]
// measure: []
// nfs:
// ---
// ============================================================================
//