123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- package config
- import (
- "io/ioutil"
- "os"
- "testing"
- )
- var confs = `
- [udp]
- locport = ":1783"
- jyaddr = "127.0.0.1"
- jyport = 11118
- [db]
- [db.mongoB]
- addr = "192.168.3.207:27092"
- dbname = "wjh"
- coll = "bidding"
- size = 15
- user = ""
- password = ""
- [db.mongoP]
- addr = "192.168.3.207:27092"
- dbname = "wjh"
- coll = "projectset"
- size = 15
- user = ""
- password = ""
- [db.mongoQ]
- addr = "192.168.3.207:27092"
- dbname = "wjh"
- coll = "projectset"
- size = 15
- user = ""
- password = ""
- [db.es]
- addr = "http://192.168.3.206:9800"
- size = 5
- indexb = "bidding"
- typeb = "bidding"
- indexp = "projectset"
- typep = "projectset"
- indexwinner = "winner"
- typewinner = "winner"
- indexbuyer = "buyer"
- typebuyer = "buyer"
- detailfilter = ["(招标网|千里马|采招网|招标采购导航网|招标与采购网|中国招投标网|中国采购与招标网|中国采购与招标|优质采)[\\w\\W]{0,15}[http|https|htpps]?[a-z0-9:\\/\\/.]{0,20}(qianlima|zhaobiao|okcis|zbytb|infobidding|bidcenter|youzhicai|chinabidding|Chinabidding|CHINABIDDING)[a-z0-9.\\/\\/]{0,40}",
- "招标网[\\w\\W]{0,15}[http|https|htpps]?[a-z0-9:\\/\\/.]{0,20}zhaobiao[a-z0-9.\\/\\/]{0,40}",
- "千里马[\\w\\W]{0,15}[a-z0-9:\\/\\/.]{0,20}qianlima[a-z0-9.\\/\\/]{0,10}",
- "[\\((]?(网址)?[::;;]?(http|https|htpps)*[::]?(\\/\\/)?(www|jinan|WWW)?.(zhaobiao|chinabidding|Chinabidding|CHINABIDDING|infobidding|zbytb|okcis|qianlima|youzhicai).(com|cn|COM|CN)?(.cn|.CN)?\\/?[\\))]?",
- "[\\((]?(网址)?(::)?(http|https|htpps)*(:|:)?\\/\\/www.bidcenter.com.cn\\/",
- "千里马(平台|网站)+", "[“\"]?优质采(平台|电子交易平台|云采购平台|交易平台)?[”\"]?", "《?(中国采购与|中国)?招(投)?标(与采购|采购导航)?网》?",
- "《?元博网(采购与招标网)?》?", "《?(中国)?招标采购导航网》?", "中\\W{0,3}国采\\W{0,3}招\\W{0,3}网\\W*[((]?(bidcenter.com.cn)?[))]?", "已方宝", "中国招标与采购"]
- [mail]
- send = false
- to = "wangjianghan@topnet.net.cn"
- api = "http://172.17.145.179:19281/_send/_mail"
- # 日志
- [log]
- # 日志路径,为空将输出控制台
- logpath = ""
- # log size (M)
- maxsize = 10
- # compress log
- compress = true
- # log save time (day)
- maxage = 7
- # save total log file total
- maxbackups = 10
- # log level
- loglevel = "debug"
- # text or json output
- format = "text"
- [db.es.fieldes]
- "_id" = ""
- "buyerzipcode" = "string"
- "winnertel" = "string"
- "winnerperson" = "string"
- "contractcode" = "string"
- "winneraddr" = "string"
- "agencyaddr" = "string"
- "buyeraddr" = "string"
- "signaturedate" = "int64"
- "projectperiod" = "string"
- "projectaddr" = "string"
- "agencytel" = "string"
- "agencyperson" = "string"
- "buyerperson" = "string"
- "agency" = "string"
- "projectscope" = "string"
- "projectcode" = "string"
- "bidopentime" = "int64"
- "supervisorrate" = "float64"
- "buyertel" = "string"
- "bidamount" = "float64"
- "winner" = "string"
- "buyer" = "string"
- "budget" = "float64"
- "projectname" = "string"
- "bidstatus" = "string"
- "buyerclass" = "string"
- "topscopeclass" = ""
- "s_topscopeclass" = "string"
- "s_subscopeclass" = "string"
- "area" = "string"
- "city" = "string"
- "district" = "string"
- "s_winner" = "string"
- "title" = "string"
- "detail" = "string"
- "site" = "string"
- "comeintime" = "int64"
- "href" = "string"
- "infoformat" = "int32"
- "publishtime" = "int64"
- "s_sha" = "string"
- "spidercode" = "string"
- "subtype" = "string"
- "toptype" = "string"
- "projectinfo" = ""
- "purchasing" = "string"
- "purchasinglist" = ""
- "channel" = "string"
- "winnerorder" = ""
- "project_scale" = "string"
- "project_duration" = "int32"
- "project_timeunit" = "string"
- "project_startdate" = "int64"
- "project_completedate" = "int64"
- "payway" = "string"
- "contract_guarantee" = "bool"
- "bid_guarantee" = "bool"
- "qualifies" = ""
- "entidlist" = ""
- "funds" = "string"
- "review_experts" = "string"
- "bidmethod" = "string"
- "bidendtime" = "int64"
- "bidopenaddress" = "string"
- "docamount" = "float64"
- "agencyrate" = "float64"
- "agencyfee" = "float64"
- "bidway" = "string"
- "getdocmethod" = "string"
- "china_bidding" = "string"
- "purchasing_tag" = "string"
- "multipackage" = "int32"
- "isValidFile" = "bool"
- "bid_field" = "string"
- [db.es.fieldprojectinfo]
- "approvecode" = "string"
- "approvecontent" = "string"
- "approvestatus" = "string"
- "approvetime" = "string"
- "approvedept" = "string"
- "approvenumber" = "string"
- "projecttype" = "string"
- "approvecity" = "string"
- [db.es.fieldpurchasinglist]
- "itemname" = "string"
- "item" = "string"
- "brandname" = "string"
- "model" = "string"
- "unitname" = "string"
- "number" = "float64"
- "unitprice" = "float64"
- "totalprice" = "float64"
- [db.es.fieldprocurementlist]
- "projectname" = "string"
- "buyer" = "string"
- "item" = "string"
- "projectscope" = "string"
- "expurasingtime" = "string"
- "totalprice" = "float64"
- [db.es.fieldwinnerorder]
- "sort" = "int"
- "sortstr" = "string"
- "entname" = "string"
- `
- func TestInit(t *testing.T) {
- testfile := "/tmp/crocodile.toml"
- ioutil.WriteFile(testfile, []byte(confs), 0644)
- Init(testfile)
- //t.Logf("%+v", Conf.DB.Es.FieldPurchasingList)
- os.Remove(testfile)
- }
|