/
client.go
74 lines (65 loc) · 1.54 KB
/
client.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
package v1alpha1
import "github.com/kotalco/kotal/apis/shared"
// Ethereum2Client is Ethereum 2.0 client
// +kubebuilder:validation:Enum=teku;prysm;lighthouse;nimbus
type Ethereum2Client string
const (
// TekuClient is ConsenSys Pegasys Ethereum 2.0 client
TekuClient Ethereum2Client = "teku"
// PrysmClient is Prysmatic Labs Ethereum 2.0 client
PrysmClient Ethereum2Client = "prysm"
// LighthouseClient is SigmaPrime Ethereum 2.0 client
LighthouseClient Ethereum2Client = "lighthouse"
// NimbusClient is Status Ethereum 2.0 client
NimbusClient Ethereum2Client = "nimbus"
)
func (client Ethereum2Client) SupportsVerbosityLevel(level shared.VerbosityLevel, validator bool) bool {
switch client {
case TekuClient:
switch level {
case shared.NoLogs,
shared.FatalLogs,
shared.ErrorLogs,
shared.WarnLogs,
shared.InfoLogs,
shared.DebugLogs,
shared.TraceLogs,
shared.AllLogs:
return true
}
case PrysmClient:
switch level {
case shared.TraceLogs,
shared.DebugLogs,
shared.InfoLogs,
shared.WarnLogs,
shared.ErrorLogs,
shared.FatalLogs,
shared.PanicLogs:
return true
}
case LighthouseClient:
switch level {
case shared.InfoLogs,
shared.DebugLogs,
shared.TraceLogs,
shared.WarnLogs,
shared.ErrorLogs,
shared.CriticalLogs:
return true
}
case NimbusClient:
switch level {
case shared.TraceLogs,
shared.DebugLogs,
shared.InfoLogs,
shared.NoticeLogs,
shared.WarnLogs,
shared.ErrorLogs,
shared.FatalLogs,
shared.NoneLogs:
return true
}
}
return false
}