 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func ApiRepoAssignment() macaron.Handler
- func ApiReqBasicAuth() macaron.Handler
- func ApiReqToken() macaron.Handler
- func AutoSignIn(ctx *Context) (bool, error)
- func Contexter() macaron.Handler
- func GitHookService() macaron.Handler
- func OrgAssignment(redirect bool, args ...bool) macaron.Handler
- func RepoAssignment(redirect bool, args ...bool) macaron.Handler
- func RepoRef() macaron.Handler
- func RequireRepoAdmin() macaron.Handler
- func Toggle(options *ToggleOptions) macaron.Handler
- type Context
- func (ctx *Context) GetErrMsg() string
- func (ctx *Context) HTML(status int, name base.TplName)
- func (ctx *Context) Handle(status int, title string, err error)
- func (ctx *Context) HandleAPI(status int, obj interface{})
- func (ctx *Context) HandleText(status int, title string)
- func (ctx *Context) HasApiError() bool
- func (ctx *Context) HasError() bool
- func (ctx *Context) HasValue(name string) bool
- func (ctx *Context) RenderWithErr(msg string, tpl base.TplName, form interface{})
- func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{})
 
- type RepoContext
- type ToggleOptions
Constants ¶
      View Source
      
  
const ( FIREFOX_COPY_SUPPORT = "41.0" CHROME_COPY_SUPPORT = "43.0.2356" )
Variables ¶
This section is empty.
Functions ¶
func ApiRepoAssignment ¶ added in v0.5.8
func ApiReqBasicAuth ¶ added in v0.5.8
func ApiReqToken ¶ added in v0.5.8
Contexter middleware already checks token for user sign in process.
func AutoSignIn ¶ added in v0.6.5
AutoSignIn reads cookie and try to auto-login.
func GitHookService ¶ added in v0.5.5
GitHookService checks if repository Git hooks service has been enabled.
func OrgAssignment ¶ added in v0.5.0
func RepoRef ¶ added in v0.5.8
RepoRef handles repository reference name including those contain `/`.
func RequireRepoAdmin ¶ added in v0.6.5
func Toggle ¶
func Toggle(options *ToggleOptions) macaron.Handler
Types ¶
type Context ¶
type Context struct {
	*macaron.Context
	Cache cache.Cache
	Flash   *session.Flash
	Session session.Store
	User        *models.User
	IsSigned    bool
	IsBasicAuth bool
	Repo RepoContext
	Org struct {
		IsOwner      bool
		IsMember     bool
		IsAdminTeam  bool // In owner team or team that has admin permission level.
		Organization *models.User
		OrgLink      string
		Team *models.Team
	}
	// contains filtered or unexported fields
}
    Context represents context of a request.
func (*Context) HandleText ¶ added in v0.6.3
func (*Context) HasApiError ¶ added in v0.4.0
HasError returns true if error occurs in form validation.
func (*Context) RenderWithErr ¶
RenderWithErr used for page has form validation but need to prompt error to users.
func (*Context) ServeContent ¶ added in v0.3.0
func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{})
type RepoContext ¶ added in v0.6.0
type RepoContext struct {
	AccessMode   models.AccessMode
	IsWatching   bool
	IsBranch     bool
	IsTag        bool
	IsCommit     bool
	Repository   *models.Repository
	Owner        *models.User
	Commit       *git.Commit
	Tag          *git.Tag
	GitRepo      *git.Repository
	BranchName   string
	TagName      string
	TreeName     string
	CommitId     string
	RepoLink     string
	CloneLink    models.CloneLink
	CommitsCount int
	Mirror       *models.Mirror
}
    func (RepoContext) HasAccess ¶ added in v0.6.0
func (r RepoContext) HasAccess() bool
Return if the current user has read access for this repository
func (RepoContext) IsAdmin ¶ added in v0.6.5
func (r RepoContext) IsAdmin() bool
IsAdmin returns true if current user has admin or higher access of repository.
func (RepoContext) IsOwner ¶ added in v0.6.0
func (r RepoContext) IsOwner() bool
IsOwner returns true if current user is the owner of repository.
 Click to show internal directories. 
   Click to hide internal directories.