33
33
DefaultTimeout = 100 * time .Millisecond
34
34
// DefaultServerIdentifier is the default value
35
35
DefaultServerIdentifier = runtime .Version ()
36
+ // DefaultServerFlavor is the default value
37
+ DefaultServerFlavor = ""
36
38
)
37
39
38
40
// HeaderExtractorFunc is a header extraction function
@@ -53,6 +55,7 @@ type ModuleConfig struct {
53
55
rpcAddress string
54
56
rpcNetwork string
55
57
serverIdentifier string
58
+ serverFlavor string
56
59
timeout time.Duration
57
60
}
58
61
@@ -72,6 +75,7 @@ func NewModuleConfig(options ...ModuleConfigOption) (*ModuleConfig, error) {
72
75
rpcAddress : DefaultRPCAddress ,
73
76
rpcNetwork : DefaultRPCNetwork ,
74
77
serverIdentifier : DefaultServerIdentifier ,
78
+ serverFlavor : DefaultServerFlavor ,
75
79
timeout : DefaultTimeout ,
76
80
}
77
81
if err := c .SetOptions (options ... ); err != nil {
@@ -185,6 +189,11 @@ func (c *ModuleConfig) ServerIdentifier() string {
185
189
return c .serverIdentifier
186
190
}
187
191
192
+ // ServerFlavor returns the configuration value
193
+ func (c * ModuleConfig ) ServerFlavor () string {
194
+ return c .serverFlavor
195
+ }
196
+
188
197
// Timeout returns the configuration value
189
198
func (c * ModuleConfig ) Timeout () time.Duration {
190
199
return c .timeout
@@ -335,6 +344,15 @@ func ServerIdentifier(id string) ModuleConfigOption {
335
344
}
336
345
}
337
346
347
+ // ServerFlavor is a function argument that sets the server
348
+ // flavor for custom setups using revproxy.
349
+ func ServerFlavor (serverModule string ) ModuleConfigOption {
350
+ return func (c * ModuleConfig ) error {
351
+ c .serverFlavor = serverModule
352
+ return nil
353
+ }
354
+ }
355
+
338
356
// FromModuleConfig allow cloning the config
339
357
func FromModuleConfig (mcfg * ModuleConfig ) ModuleConfigOption {
340
358
return func (c * ModuleConfig ) error {
0 commit comments