30 lines
731 B
Go
30 lines
731 B
Go
package config
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"micro_layout/internal/configs"
|
|
"micro_layout/internal/queue/jetstream"
|
|
"micro_layout/internal/storage"
|
|
)
|
|
|
|
type Config struct {
|
|
App configs.AppConfig `mapstructure:"app"`
|
|
Server configs.ServerConfig `mapstructure:"server"`
|
|
Storage storage.Config `mapstructure:"storage"`
|
|
JetStream jetstream.Config `mapstructure:"jetstream"`
|
|
Log configs.LogConfig `mapstructure:"log"`
|
|
Registry configs.RegistryConfig `mapstructure:"registry"`
|
|
}
|
|
|
|
func (cfg Config) Validate() error {
|
|
return errors.Join(
|
|
cfg.App.Validate(),
|
|
cfg.Server.Validate(),
|
|
cfg.Registry.Validate(),
|
|
cfg.Log.Validate(),
|
|
cfg.Storage.Validate(),
|
|
cfg.JetStream.Validate(),
|
|
)
|
|
}
|