-
Notifications
You must be signed in to change notification settings - Fork 0
/
appStatusHandlerStub.go
66 lines (57 loc) · 1.98 KB
/
appStatusHandlerStub.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
package mock
// AppStatusHandlerStub is a stub implementation of AppStatusHandler
type AppStatusHandlerStub struct {
AddUint64Handler func(key string, value uint64)
IncrementHandler func(key string)
DecrementHandler func(key string)
SetUInt64ValueHandler func(key string, value uint64)
SetInt64ValueHandler func(key string, value int64)
SetStringValueHandler func(key string, value string)
CloseHandler func()
}
// IsInterfaceNil -
func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool {
return ashs == nil
}
// AddUint64 will call the handler of the stub for incrementing
func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64) {
if ashs.AddUint64Handler != nil {
ashs.AddUint64Handler(key, value)
}
}
// Increment will call the handler of the stub for incrementing
func (ashs *AppStatusHandlerStub) Increment(key string) {
if ashs.IncrementHandler != nil {
ashs.IncrementHandler(key)
}
}
// Decrement will call the handler of the stub for decrementing
func (ashs *AppStatusHandlerStub) Decrement(key string) {
if ashs.DecrementHandler != nil {
ashs.DecrementHandler(key)
}
}
// SetInt64Value will call the handler of the stub for setting an int64 value
func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64) {
if ashs.SetInt64ValueHandler != nil {
ashs.SetInt64ValueHandler(key, value)
}
}
// SetUInt64Value will call the handler of the stub for setting an uint64 value
func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64) {
if ashs.SetUInt64ValueHandler != nil {
ashs.SetUInt64ValueHandler(key, value)
}
}
// SetStringValue will call the handler of the stub for setting an string value
func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string) {
if ashs.SetStringValueHandler != nil {
ashs.SetStringValueHandler(key, value)
}
}
// Close will call the handler of the stub for closing
func (ashs *AppStatusHandlerStub) Close() {
if ashs.CloseHandler != nil {
ashs.CloseHandler()
}
}