-
Notifications
You must be signed in to change notification settings - Fork 11
/
config.go
47 lines (40 loc) · 1.35 KB
/
config.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
package operator
import (
"github.com/containers-ai/federatorai-operator/pkg/log"
"github.com/containers-ai/federatorai-operator/pkg/protocol/grpc"
)
// RequirementsConfig encapsultes the truth of requirements resources
type RequirementsConfig struct {
}
// NewDefaultRequirementsConfig creates default configuration
func NewDefaultRequirementsConfig() RequirementsConfig {
return RequirementsConfig{}
}
// Config encapsultes configuration of federatorai operator
type Config struct {
Requirements RequirementsConfig `mapstructure:"requirements"`
Metrics MetricsConfig `mapstructure:"metrics"`
Log log.Config `mapstructure:"log"`
GRPC grpc.Config `mapstructure:"grpc"`
}
// NewDefaultConfig creates operator default configuration
func NewDefaultConfig() Config {
return Config{
Requirements: NewDefaultRequirementsConfig(),
Metrics: NewDefaultMetricsConfig(),
Log: log.NewDefaultConfig(),
GRPC: grpc.NewDefaultConfig(),
}
}
// MetricsConfig encapsultes configuration of federatorai operator metrics server
type MetricsConfig struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
}
// NewDefaultMetricsConfig creates operator's metrics server default configuration
func NewDefaultMetricsConfig() MetricsConfig {
return MetricsConfig{
Host: "0.0.0.0",
Port: 8383,
}
}