mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-08 07:42:27 +08:00
avatar img use cache
This commit is contained in:
@@ -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
6
glide.lock
generated
@@ -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
7
vendor/gopkg.in/yaml.v2/decode.go
generated
vendored
@@ -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
|
||||
|
||||
11
vendor/gopkg.in/yaml.v2/decode_test.go
generated
vendored
11
vendor/gopkg.in/yaml.v2/decode_test.go
generated
vendored
@@ -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
13
vendor/gopkg.in/yaml.v2/yaml.go
generated
vendored
@@ -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
Reference in New Issue
Block a user