Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
a1f6039d
Commit
a1f6039d
authored
Dec 24, 2013
by
傅小黑
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofmt code
parent
0183608a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
11 deletions
+10
-11
file.go
cache/file.go
+3
-3
config.go
config/config.go
+1
-1
ini.go
config/ini.go
+1
-1
json.go
config/json.go
+5
-5
xml.go
config/xml.go
+0
-1
No files found.
cache/file.go
View file @
a1f6039d
...
...
@@ -34,9 +34,9 @@ type FileCacheItem struct {
var
(
FileCachePath
string
=
"cache"
// cache directory
FileCacheFileSuffix
string
=
".bin"
// cache file suffix
FileCacheDirectoryLevel
int
=
2
// cache file deep level if auto generated cache files.
FileCacheEmbedExpiry
int64
=
0
// cache expire time, default is no expire forever.
FileCacheFileSuffix
string
=
".bin"
// cache file suffix
FileCacheDirectoryLevel
int
=
2
// cache file deep level if auto generated cache files.
FileCacheEmbedExpiry
int64
=
0
// cache expire time, default is no expire forever.
)
// FileCache is cache adapter for file storage.
...
...
config/config.go
View file @
a1f6039d
...
...
@@ -7,7 +7,7 @@ import (
// ConfigContainer defines how to get and set value from configuration raw data.
type
ConfigContainer
interface
{
Set
(
key
,
val
string
)
error
// support section::key type in given key when using ini type.
String
(
key
string
)
string
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
String
(
key
string
)
string
// support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same.
Int
(
key
string
)
(
int
,
error
)
Int64
(
key
string
)
(
int64
,
error
)
Bool
(
key
string
)
(
bool
,
error
)
...
...
config/ini.go
View file @
a1f6039d
...
...
@@ -13,7 +13,7 @@ import (
)
var
(
DEFAULT_SECTION
=
"default"
// default section means if some ini items not in a section, make them in default section,
DEFAULT_SECTION
=
"default"
// default section means if some ini items not in a section, make them in default section,
bNumComment
=
[]
byte
{
'#'
}
// number signal
bSemComment
=
[]
byte
{
';'
}
// semicolon signal
bEmpty
=
[]
byte
{}
...
...
config/json.go
View file @
a1f6039d
...
...
@@ -53,7 +53,7 @@ func (c *JsonConfigContainer) Bool(key string) (bool, error) {
}
else
{
return
false
,
errors
.
New
(
"not exist key:"
+
key
)
}
return
false
,
nil
return
false
,
nil
}
// Int returns the integer value for a given key.
...
...
@@ -68,7 +68,7 @@ func (c *JsonConfigContainer) Int(key string) (int, error) {
}
else
{
return
0
,
errors
.
New
(
"not exist key:"
+
key
)
}
return
0
,
nil
return
0
,
nil
}
// Int64 returns the int64 value for a given key.
...
...
@@ -83,7 +83,7 @@ func (c *JsonConfigContainer) Int64(key string) (int64, error) {
}
else
{
return
0
,
errors
.
New
(
"not exist key:"
+
key
)
}
return
0
,
nil
return
0
,
nil
}
// Float returns the float value for a given key.
...
...
@@ -98,7 +98,7 @@ func (c *JsonConfigContainer) Float(key string) (float64, error) {
}
else
{
return
0.0
,
errors
.
New
(
"not exist key:"
+
key
)
}
return
0.0
,
nil
return
0.0
,
nil
}
// String returns the string value for a given key.
...
...
@@ -132,7 +132,7 @@ func (c *JsonConfigContainer) DIY(key string) (v interface{}, err error) {
}
else
{
return
nil
,
errors
.
New
(
"not exist key"
)
}
return
nil
,
nil
return
nil
,
nil
}
// section.key or key
...
...
config/xml.go
View file @
a1f6039d
package
config
import
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment