Skip to content

A golang package for beego including simplified error/response handling and pagination

License

Notifications You must be signed in to change notification settings

zebresel-com/beego-response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

beego-response

This is an additional golang package for the beego web framework to simplify error and response handling within controllers. It wraps functionality of *BeegoOutput.

Example project for a use case can be found in the mongodm-example package.

Advantages

  • pagination
  • direct JSON error response
  • custom data appending

Example

  func (self *UsersController) Me() {
	  if self.token != nil && self.user != nil {
		  self.response.AddContent("user", self.user)
		  self.response.ServeJSON()
	  } else {
	    self.response.Error(http.StatusBadRequest)
	  }
  }

Feel free to contribute!

About

A golang package for beego including simplified error/response handling and pagination

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages