| | |
| | | JwtSecret string `mapstructure: "jwtSecret"` |
| | | JwtExpire string `mapstructure: "jwtExpire"` |
| | | Url string `mapstructure: "url"` |
| | | AnalyServerId string `mapstructure: "analyServerId"` |
| | | ImageUrl string `mapstructure: "imageUrl"` |
| | | PublicDomain string `mapstructure: "publicDomain"` |
| | | NetworkAdapter string `mapstructure: "networkAdapter"` |
| | |
| | | |
| | | var WeedFs = &weedfs{} |
| | | |
| | | type redis struct { |
| | | Host string `mapstructure:"host"` |
| | | Port int `mapstructure:"port"` |
| | | Password string `mapstructure:"password` |
| | | DBNum int `mapstructure:"db"` |
| | | } |
| | | |
| | | var RedisConf = &redis{} |
| | | |
| | | type database struct { |
| | | Drive string `mapstructure:"drive"` |
| | | Name string `mapstructure:"name"` |
| | |
| | | type esinfo struct { |
| | | Masterip string `mapstructure:"masterip"` |
| | | Httpport string `mapstructure:"httpport"` |
| | | Shards string `mapstructure:"shards"` |
| | | EsIndex esindexlist `mapstructure:"index"` |
| | | } |
| | | |
| | |
| | | var DBconf = &database{} |
| | | |
| | | type facedetect struct { |
| | | Url string `mapstructure:"url"` |
| | | Ip string `mapstructure:"Ip"` |
| | | Port int `mapstructure:"port"` |
| | | } |
| | | |
| | | type dbpersoncompare struct { |
| | | Url string `mapstructure:"url"` |
| | | Ip string `mapstructure:"ip"` |
| | | Port int `mapstructure:"port"` |
| | | } |
| | | |
| | | type espersoncompare struct { |
| | | Url []string `mapstructure:"url"` |
| | | Port int `mapstructure:"port"` |
| | | Ips []string `mapstructure:"ips"` |
| | | } |
| | | |
| | | var DbPersonCompInfo = &dbpersoncompare{} |
| | |
| | | var err error |
| | | viper.SetConfigType("yaml") |
| | | viper.SetConfigName(env) |
| | | viper.AddConfigPath("../config/") |
| | | viper.AddConfigPath("config/") |
| | | viper.AddConfigPath("/opt/vasystem/config/") |
| | | viper.AddConfigPath("") |
| | | err = viper.ReadInConfig() |
| | | if err != nil { |
| | | log.Fatal("error on parsing configuration file") |
| | | } |
| | | viper.UnmarshalKey("es", EsInfo) |
| | | viper.UnmarshalKey("server", Server) |
| | | viper.UnmarshalKey("redis", RedisConf) |
| | | viper.UnmarshalKey("database", DBconf) |
| | | viper.UnmarshalKey("weedfs", WeedFs) |
| | | viper.UnmarshalKey("sopath",SoPath) |