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
48ad0202
Commit
48ad0202
authored
Dec 07, 2013
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update some tips
parent
2220968a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
9 deletions
+21
-9
admin.go
admin.go
+10
-1
httplib_test.go
httplib/httplib_test.go
+1
-1
conn.go
logs/conn.go
+1
-2
README.md
session/README.md
+9
-5
No files found.
admin.go
View file @
48ad0202
...
...
@@ -53,7 +53,16 @@ func ProfIndex(rw http.ResponseWriter, r *http.Request) {
if
command
!=
""
{
toolbox
.
ProcessInput
(
command
,
rw
)
}
else
{
rw
.
Write
([]
byte
(
"request url like '/prof?command=lookup goroutine'"
))
rw
.
Write
([]
byte
(
"request url like '/prof?command=lookup goroutine'
\n
"
))
rw
.
Write
([]
byte
(
"the command have below types:
\n
"
))
rw
.
Write
([]
byte
(
"1. lookup goroutine
\n
"
))
rw
.
Write
([]
byte
(
"2. lookup heap
\n
"
))
rw
.
Write
([]
byte
(
"3. lookup threadcreate
\n
"
))
rw
.
Write
([]
byte
(
"4. lookup block
\n
"
))
rw
.
Write
([]
byte
(
"5. start cpuprof
\n
"
))
rw
.
Write
([]
byte
(
"6. stop cpuprof
\n
"
))
rw
.
Write
([]
byte
(
"7. get memprof
\n
"
))
rw
.
Write
([]
byte
(
"8. gc summary
\n
"
))
}
}
...
...
httplib/httplib_test.go
View file @
48ad0202
...
...
@@ -6,7 +6,7 @@ import (
)
func
TestGetUrl
(
t
*
testing
.
T
)
{
resp
,
err
:=
Get
(
"http://beego.me/"
)
.
Response
()
resp
,
err
:=
Get
(
"http://beego.me/"
)
.
Debug
(
true
)
.
Response
()
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
logs/conn.go
View file @
48ad0202
...
...
@@ -87,8 +87,7 @@ func (c *ConnWriter) connect() error {
return
err
}
tcpConn
,
ok
:=
conn
.
(
*
net
.
TCPConn
)
if
ok
{
if
tcpConn
,
ok
:=
conn
.
(
*
net
.
TCPConn
);
ok
{
tcpConn
.
SetKeepAlive
(
true
)
}
...
...
session/README.md
View file @
48ad0202
...
...
@@ -81,17 +81,21 @@ Writing a provider is easy. You only need to define two struct types
Maybe you will find the
**memory**
provider as good example.
type SessionStore interface {
Set(key, value interface{}) error // set session value
Get(key interface{}) interface{} // get session value
Delete(key interface{}) error // delete session value
SessionID() string // return current sessionID
SessionRelease() // release the resource
Set(key, value interface{}) error //set session value
Get(key interface{}) interface{} //get session value
Delete(key interface{}) error //delete session value
SessionID() string //back current sessionID
SessionRelease() // release the resource & save data to provider
Flush() error //delete all data
}
type Provider interface {
SessionInit(maxlifetime int64, savePath string) error
SessionRead(sid string) (SessionStore, error)
SessionExist(sid string) bool
SessionRegenerate(oldsid, sid string) (SessionStore, error)
SessionDestroy(sid string) error
SessionAll() int //get all active session
SessionGC()
}
...
...
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