CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6d3e12fbf313 halcms "/bin/sh -c 'echo ..." 24 hours ago Up 24 hours 0.0.0.0:8083->8080/tcp docker_halcms-app_1 2f532a830e88 elasticsearch:2.3.5 "/docker-entrypoin..." 2 years ago Up 4 weeks 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp halcms-elasticsearch 8e73d3c2b62d 6fd9e186667b "/bin/sh -c 'sh -c..." 2 years ago Exited (127) 2 years ago adoring_curran cfc19946e8b6 817e3ed9255c "/bin/sh -c 'sh -c..." 2 years ago Exited (127) 2 years ago elated_banach
使用docker system df命令查看Docker的磁盘使用情况
1 2 3 4
TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 94 2 18.77GB 18.22GB (97%) Containers 4 2 60.17kB 0B (0%) Local Volumes 2 2 6.92MB 0B (0%)
request, _:=http.NewRequest(http.MethodGet,newUrl,nil) request.Header.Add("User-Agent","Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1")
//解析城市信息 funcParseCityList(contents []byte)engine.ParseResult { re := regexp.MustCompile(cityListRe) all := re.FindAllSubmatch(contents, -1) result := engine.ParseResult{} i := 0
for _, c := range all { result.Items = append(result.Items, string(c[2])) //城市名字 result.Requests = append(result.Requests, engine.Request{ Url: string(c[1]), ParserFunc: ParseCity, })
infos, err := res.Get("objectInfo").Get("basicInfo").Array() //infos是一个切片,里面的类型是interface{} //fmt.Printf("infos:%v, %T\n", infos, infos) //infos:[离异 47岁 射手座(11.22-12.21) 157cm 55kg 工作地:阿坝汶川 月收入:3-5千 教育/科研 大学本科], []interface {} var profile model.Profile //所以我们遍历这个切片,里面使用断言来判断类型 for k, v := range infos { //fmt.Printf("k:%v,%T\n", k, k) //fmt.Printf("v:%v,%T\n", v, v) /* "basicInfo":[ "未婚", "25岁", "魔羯座(12.22-01.19)", "152cm", "42kg", "工作地:阿坝茂县", "月收入:3-5千", "医生", "大专" ], */ if e, ok := v.(string); ok { switch k { case0: profile.Marriage = e case1: //年龄:47岁,我们可以设置int类型,所以可以通过另一个json字段来获取 profile.Age = e case2: profile.Xingzuo = e case3: profile.Height = e case4: profile.Weight = e case6: profile.Income = e case7: profile.Occupation = e case8: profile.Education = e } } } return profile }
user.go
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package model
//珍爱网用户对象模型 type Profile struct { Name string//姓名 Marriage string//婚况 Age string//年龄 Gender string//性别 Height string//身高 Weight string//体重 Income string//收入 Education string//教育 Occupation string//职业 Hukou string//籍贯户口 Xingzuo string//星座 House string//房子 Car string//车 }
sed -i "s@http://.*archive.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list sed -i "s@http://.*security.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list