init project
This commit is contained in:
1 parent
d63cc8d9f5
commit
ee07869839
39 files changed
+1560
-622
No files matched your search
@@ -1,14 +1,29 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"git.xiaotuo.co/micro/skeleton/internal/queue/jetstream"
|
||||
"git.xiaotuo.co/micro/skeleton/internal/storage"
|
||||
"errors"
|
||||
|
||||
"micro_layout/internal/configs"
|
||||
"micro_layout/internal/queue/jetstream"
|
||||
"micro_layout/internal/storage"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Env string `json:"env"`
|
||||
Port string `json:"port"`
|
||||
Storage storage.Config `json:"storage"`
|
||||
JetStream jetstream.Config `json:"jet_stream"`
|
||||
EtcdServer string `json:"etcd_server"`
|
||||
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(),
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user