-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
confighandler.go
40 lines (38 loc) · 1.39 KB
/
confighandler.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
package configuration
import "github.com/janmbaco/go-infrastructure/configuration/events"
type (
// ModificationCanceledSubscriber defines an object responsible to subscribe function for the event ModificationCanceled
ModificationCanceledSubscriber interface {
ModificationCanceledSubscribe(*func(eventArgs *events.ModificationCanceledEventArgs))
ModificationCanceledUnsubscribe(*func(eventArgs *events.ModificationCanceledEventArgs))
}
// RestoredSubscriber defines an object responsible to subscribe function for the event Restored
RestoredSubscriber interface {
RestoredSubscribe(*func())
RestoredUnsubscribe(*func())
}
// ModifyingSubscriber defines an object responsible to subscribe function for the event Modifying
ModifyingSubscriber interface {
ModifyingSubscribe(*func(eventArgs *events.ModifyingEventArgs))
ModifyingUnsubscribe(*func(eventArgs *events.ModifyingEventArgs))
}
// ModifiedSubscriber defines an object responsible to subscribe function for the event Modified
ModifiedSubscriber interface {
ModifiedSubscribe(*func())
ModifiedUnsubscribe(*func())
}
// ConfigHandler defines a object that handles the configuration
ConfigHandler interface {
ModifiedSubscriber
ModifyingSubscriber
ModificationCanceledSubscriber
RestoredSubscriber
GetConfig() interface{}
Freeze()
Unfreeze()
CanRestore() bool
Restore()
SetRefreshTime(Period)
ForceRefresh()
}
)