avatar img use cache

This commit is contained in:
deepzz0
2017-07-13 01:37:35 +08:00
parent c18d9c0bef
commit e0a5f0ebca
7 changed files with 35 additions and 10 deletions

View File

@@ -61,7 +61,7 @@ mode:
enablehttp: true
httpport: 9000
# https server
enablehttps: true
enablehttps: false
autocert: false
httpsport: 9001
certfile: conf/ssl/domain.rsa.pem

6
glide.lock generated
View File

@@ -1,5 +1,5 @@
hash: bd360fa297ed66950543990f9433cdcdf13c29dd99d9a01b49027e236b2cb9da
updated: 2017-07-11T23:49:28.770307187+08:00
updated: 2017-07-13T01:29:28.226895963+08:00
imports:
- name: github.com/boj/redistore
version: 4562487a4bee9a7c272b72bfaeda4917d0a47ab9
@@ -8,7 +8,7 @@ imports:
- name: github.com/eiblog/blackfriday
version: c0ec111761ae784fe31cc076f2fa0e2d2216d623
- name: github.com/eiblog/utils
version: 5699bde749ca1053867528834492263f841620ad
version: ddfd888542f9a093000f71c3709009c1440a0789
subpackages:
- logd
- mgo
@@ -86,7 +86,7 @@ imports:
- internal/sasl
- internal/scram
- name: gopkg.in/yaml.v2
version: cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b
version: 1be3d31502d6eabc0dd7ce5b0daab022e14a5538
- name: qiniupkg.com/api.v7
version: 9c12a67868f8f94d6a75dd6bb59b095db8d40d77
subpackages:

7
vendor/gopkg.in/yaml.v2/decode.go generated vendored
View File

@@ -190,6 +190,7 @@ type decoder struct {
aliases map[string]bool
mapType reflect.Type
terrors []string
strict bool
}
var (
@@ -199,8 +200,8 @@ var (
ifaceType = defaultMapType.Elem()
)
func newDecoder() *decoder {
d := &decoder{mapType: defaultMapType}
func newDecoder(strict bool) *decoder {
d := &decoder{mapType: defaultMapType, strict: strict}
d.aliases = make(map[string]bool)
return d
}
@@ -639,6 +640,8 @@ func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) {
value := reflect.New(elemType).Elem()
d.unmarshal(n.children[i+1], value)
inlineMap.SetMapIndex(name, value)
} else if d.strict {
d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s not found in struct %s", n.line+1, name.String(), out.Type()))
}
}
return true

View File

@@ -968,6 +968,17 @@ func (s *S) TestUnmarshalSliceOnPreset(c *C) {
c.Assert(v.A, DeepEquals, []int{2})
}
func (s *S) TestUnmarshalStrict(c *C) {
v := struct{ A, B int }{}
err := yaml.UnmarshalStrict([]byte("a: 1\nb: 2"), &v)
c.Check(err, IsNil)
err = yaml.Unmarshal([]byte("a: 1\nb: 2\nc: 3"), &v)
c.Check(err, IsNil)
err = yaml.UnmarshalStrict([]byte("a: 1\nb: 2\nc: 3"), &v)
c.Check(err, ErrorMatches, "yaml: unmarshal errors:\n line 1: field c not found in struct struct { A int; B int }")
}
//var data []byte
//func init() {
// var err error

13
vendor/gopkg.in/yaml.v2/yaml.go generated vendored
View File

@@ -77,8 +77,19 @@ type Marshaler interface {
// supported tag options.
//
func Unmarshal(in []byte, out interface{}) (err error) {
return unmarshal(in, out, false)
}
// UnmarshalStrict is like Unmarshal except that any fields that are found
// in the data that do not have corresponding struct members will result in
// an error.
func UnmarshalStrict(in []byte, out interface{}) (err error) {
return unmarshal(in, out, true)
}
func unmarshal(in []byte, out interface{}, strict bool) (err error) {
defer handleErr(&err)
d := newDecoder()
d := newDecoder(strict)
p := newParser(in)
defer p.destroy()
node := p.parse()

File diff suppressed because one or more lines are too long

4
xml.go
View File

@@ -25,8 +25,8 @@ func init() {
if err != nil {
logd.Fatal(err)
}
go doFeed()
go doSitemap()
doFeed()
doSitemap()
doOpensearch()
doRobots()
doCrossdomain()