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
eae21477
Commit
eae21477
authored
Mar 30, 2016
by
mishudark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(output.go): delete not used variable (status int) in check status functions
parent
88c5dfa6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
output.go
context/output.go
+9
-9
No files found.
context/output.go
View file @
eae21477
...
...
@@ -269,55 +269,55 @@ func (output *BeegoOutput) SetStatus(status int) {
// IsCachable returns boolean of this request is cached.
// HTTP 304 means cached.
func
(
output
*
BeegoOutput
)
IsCachable
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsCachable
()
bool
{
return
output
.
Status
>=
200
&&
output
.
Status
<
300
||
output
.
Status
==
304
}
// IsEmpty returns boolean of this request is empty.
// HTTP 201,204 and 304 means empty.
func
(
output
*
BeegoOutput
)
IsEmpty
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsEmpty
()
bool
{
return
output
.
Status
==
201
||
output
.
Status
==
204
||
output
.
Status
==
304
}
// IsOk returns boolean of this request runs well.
// HTTP 200 means ok.
func
(
output
*
BeegoOutput
)
IsOk
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsOk
()
bool
{
return
output
.
Status
==
200
}
// IsSuccessful returns boolean of this request runs successfully.
// HTTP 2xx means ok.
func
(
output
*
BeegoOutput
)
IsSuccessful
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsSuccessful
()
bool
{
return
output
.
Status
>=
200
&&
output
.
Status
<
300
}
// IsRedirect returns boolean of this request is redirection header.
// HTTP 301,302,307 means redirection.
func
(
output
*
BeegoOutput
)
IsRedirect
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsRedirect
()
bool
{
return
output
.
Status
==
301
||
output
.
Status
==
302
||
output
.
Status
==
303
||
output
.
Status
==
307
}
// IsForbidden returns boolean of this request is forbidden.
// HTTP 403 means forbidden.
func
(
output
*
BeegoOutput
)
IsForbidden
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsForbidden
()
bool
{
return
output
.
Status
==
403
}
// IsNotFound returns boolean of this request is not found.
// HTTP 404 means forbidden.
func
(
output
*
BeegoOutput
)
IsNotFound
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsNotFound
()
bool
{
return
output
.
Status
==
404
}
// IsClientError returns boolean of this request client sends error data.
// HTTP 4xx means forbidden.
func
(
output
*
BeegoOutput
)
IsClientError
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsClientError
()
bool
{
return
output
.
Status
>=
400
&&
output
.
Status
<
500
}
// IsServerError returns boolean of this server handler errors.
// HTTP 5xx means server internal error.
func
(
output
*
BeegoOutput
)
IsServerError
(
status
int
)
bool
{
func
(
output
*
BeegoOutput
)
IsServerError
()
bool
{
return
output
.
Status
>=
500
&&
output
.
Status
<
600
}
...
...
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