zotregistry.io/zot@v1.4.4-0.20231124084042-02a8ed785457/pkg/exporter/api/config.go (about) 1 //go:build !metrics 2 // +build !metrics 3 4 package api 5 6 // We export below types in order for cli package to be able to read it from configuration file. 7 type LogConfig struct { 8 Level string 9 Output string 10 } 11 12 type MetricsConfig struct { 13 Path string 14 } 15 16 type ServerConfig struct { 17 Protocol string 18 Host string 19 Port string 20 } 21 22 type ExporterConfig struct { 23 Port string 24 Log *LogConfig 25 Metrics *MetricsConfig 26 } 27 28 type Config struct { 29 Server ServerConfig 30 Exporter ExporterConfig 31 } 32 33 func DefaultConfig() *Config { 34 return &Config{ 35 Server: ServerConfig{Protocol: "http", Host: "localhost", Port: "8080"}, 36 Exporter: ExporterConfig{Port: "8081", Log: &LogConfig{Level: "debug"}, Metrics: &MetricsConfig{Path: "/metrics"}}, 37 } 38 }