Documentation
¶
Index ¶
- func AssignRepository() macaron.Handler
- func AssignUser() macaron.Handler
- func CheckRepoExpiry() macaron.Handler
- func Contexter() macaron.Handler
- func GitUACheck() macaron.Handler
- func Toggle(options *ToggleOptions) macaron.Handler
- type Context
- func (c *Context) HTML(status int, name string)
- func (c *Context) Handle(status int, title string, err error)
- func (c *Context) HandleText(status int, title string)
- func (c *Context) HasError() bool
- func (c *Context) JSONSuccess(data interface{})
- func (c *Context) NotFound()
- func (c *Context) NotFoundOrServerError(title string, errck func(error) bool, err error)
- func (c *Context) PageIs(name string)
- func (c *Context) RenderWithErr(msg, tpl string, f interface{})
- func (c *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{})
- func (c *Context) ServeContentNoDownload(name string, mime string, r io.ReadSeeker, params ...interface{})
- func (c *Context) ServerError(title string, err error)
- func (c *Context) SubURLRedirect(location string, status ...int)
- func (c *Context) Success(name string)
- func (c *Context) Title(locale string)
- type Gitxt
- type ToggleOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
*macaron.Context
Cache cache.Cache
Flash *session.Flash
Session session.Store
User *models.User // logged in user
Gitxt *Gitxt
RepoOwnerUsername string
IsLogged bool
IsBasicAuth bool
// contains filtered or unexported fields
}
Context represents context of a request.
func (*Context) JSONSuccess ¶
func (c *Context) JSONSuccess(data interface{})
JSONSuccess responses JSON with status http.StatusOK.
func (*Context) NotFoundOrServerError ¶
NotFoundOrServerError use error check function to determine if the error is about not found. It responses with 404 status code for not found error, or error context description for logging purpose of 500 server error.
func (*Context) RenderWithErr ¶
RenderWithErr used for page has form validation but need to prompt error to users.
func (*Context) ServeContent ¶
func (c *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{})
ServeContent headers
func (*Context) ServeContentNoDownload ¶
func (c *Context) ServeContentNoDownload(name string, mime string, r io.ReadSeeker, params ...interface{})
ServeContentNoDownload headers
func (*Context) ServerError ¶
ServerError renders the 500 page.
func (*Context) SubURLRedirect ¶
SubURLRedirect responses redirection with given location and status. It prepends setting.AppSubURL to the location string.
Click to show internal directories.
Click to hide internal directories.