| | |
| | | fileTemplateConf struct { |
| | | InputSelfmadeAddr string //入库自制单模版地址 |
| | | } |
| | | |
| | | dingTalkConf struct { |
| | | AlarmKey string |
| | | AlarmUrl string |
| | | } |
| | | ) |
| | | |
| | | var ( |
| | |
| | | LocalConf = &localConf{} |
| | | Viper *viper.Viper |
| | | GrpcServerConf = &grpcServerConf{} |
| | | DingTalkConf = &dingTalkConf{} |
| | | ) |
| | | |
| | | func Init() error { |
| | |
| | | _ = v.UnmarshalKey("db", DbConf) |
| | | _ = v.UnmarshalKey("local", LocalConf) |
| | | _ = v.UnmarshalKey("grpcServer", GrpcServerConf) |
| | | _ = v.UnmarshalKey("dingTalk", DingTalkConf) |
| | | showConfig() |
| | | } |
| | | |
| | |
| | | log.Printf(" DbConf: %+v", DbConf) |
| | | log.Printf(" LocalConf: %+v", LocalConf) |
| | | log.Printf(" GrpcServerConf: %+v", GrpcServerConf) |
| | | log.Printf(" DingTalkConf: %+v", DingTalkConf) |
| | | log.Println("......................................................") |
| | | } |