repo

package
v0.11.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2017 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BRANCHES_OVERVIEW = "repo/branches/overview"
	BRANCHES_ALL      = "repo/branches/all"
)
View Source
const (
	COMMITS = "repo/commits"
	DIFF    = "repo/diff/page"
)
View Source
const (
	EDIT_FILE         = "repo/editor/edit"
	EDIT_DIFF_PREVIEW = "repo/editor/diff_preview"
	DELETE_FILE       = "repo/editor/delete"
	UPLOAD_FILE       = "repo/editor/upload"
)
View Source
const (
	ENV_AUTH_USER_ID           = "GOGS_AUTH_USER_ID"
	ENV_AUTH_USER_NAME         = "GOGS_AUTH_USER_NAME"
	ENV_AUTH_USER_EMAIL        = "GOGS_AUTH_USER_EMAIL"
	ENV_REPO_OWNER_NAME        = "GOGS_REPO_OWNER_NAME"
	ENV_REPO_OWNER_SALT_MD5    = "GOGS_REPO_OWNER_SALT_MD5"
	ENV_REPO_ID                = "GOGS_REPO_ID"
	ENV_REPO_NAME              = "GOGS_REPO_NAME"
	ENV_REPO_CUSTOM_HOOKS_PATH = "GOGS_REPO_CUSTOM_HOOKS_PATH"
)
View Source
const (
	ISSUES     = "repo/issue/list"
	ISSUE_NEW  = "repo/issue/new"
	ISSUE_VIEW = "repo/issue/view"

	LABELS = "repo/issue/labels"

	MILESTONE      = "repo/issue/milestones"
	MILESTONE_NEW  = "repo/issue/milestone_new"
	MILESTONE_EDIT = "repo/issue/milestone_edit"

	ISSUE_TEMPLATE_KEY = "IssueTemplate"
)
View Source
const (
	FORK         = "repo/pulls/fork"
	COMPARE_PULL = "repo/pulls/compare"
	PULL_COMMITS = "repo/pulls/commits"
	PULL_FILES   = "repo/pulls/files"

	PULL_REQUEST_TEMPLATE_KEY = "PullRequestTemplate"
)
View Source
const (
	RELEASES    = "repo/release/list"
	RELEASE_NEW = "repo/release/new"
)
View Source
const (
	CREATE  = "repo/create"
	MIGRATE = "repo/migrate"
)
View Source
const (
	SETTINGS_OPTIONS          = "repo/settings/options"
	SETTINGS_COLLABORATION    = "repo/settings/collaboration"
	SETTINGS_BRANCHES         = "repo/settings/branches"
	SETTINGS_PROTECTED_BRANCH = "repo/settings/protected_branch"
	SETTINGS_GITHOOKS         = "repo/settings/githooks"
	SETTINGS_GITHOOK_EDIT     = "repo/settings/githook_edit"
	SETTINGS_DEPLOY_KEYS      = "repo/settings/deploy_keys"
)
View Source
const (
	BARE     = "repo/bare"
	HOME     = "repo/home"
	WATCHERS = "repo/watchers"
	FORKS    = "repo/forks"
)
View Source
const (
	WEBHOOKS        = "repo/settings/webhook/base"
	WEBHOOK_NEW     = "repo/settings/webhook/new"
	ORG_WEBHOOK_NEW = "org/settings/webhook_new"
)
View Source
const (
	WIKI_START = "repo/wiki/start"
	WIKI_VIEW  = "repo/wiki/view"
	WIKI_NEW   = "repo/wiki/new"
	WIKI_PAGES = "repo/wiki/pages"
)

Variables

View Source
var (
	ErrFileTypeForbidden = errors.New("File type is not allowed")
	ErrTooManyFiles      = errors.New("Maximum number of files to upload exceeded")

	IssueTemplateCandidates = []string{
		"ISSUE_TEMPLATE.md",
		".gogs/ISSUE_TEMPLATE.md",
		".github/ISSUE_TEMPLATE.md",
	}
)
View Source
var (
	PullRequestTemplateCandidates = []string{
		"PULL_REQUEST.md",
		".gogs/PULL_REQUEST.md",
		".github/PULL_REQUEST.md",
	}
)

Functions

func Action

func Action(c *context.Context)

func AllBranches added in v0.10.18

func AllBranches(c *context.Context)

func Branches

func Branches(c *context.Context)

func ChangeCollaborationAccessMode added in v0.9.0

func ChangeCollaborationAccessMode(c *context.Context)

func ChangeMilestonStatus added in v0.6.5

func ChangeMilestonStatus(c *context.Context)

func Commits

func Commits(c *context.Context)

func CompareAndPullRequest added in v0.6.5

func CompareAndPullRequest(c *context.Context)

func CompareAndPullRequestPost added in v0.6.9

func CompareAndPullRequestPost(c *context.Context, f form.NewIssue)

func CompareDiff added in v0.5.0

func CompareDiff(c *context.Context)

func ComposeHookEnvs added in v0.10.1

func ComposeHookEnvs(opts ComposeHookEnvsOptions) []string

func Create

func Create(c *context.Context)

func CreatePost added in v0.3.0

func CreatePost(c *context.Context, f form.CreateRepo)

func DeleteBranchPost added in v0.9.113

func DeleteBranchPost(c *context.Context)

func DeleteCollaboration added in v0.9.0

func DeleteCollaboration(c *context.Context)

func DeleteComment added in v0.9.60

func DeleteComment(c *context.Context)

func DeleteDeployKey added in v0.6.5

func DeleteDeployKey(c *context.Context)

func DeleteFile added in v0.9.97

func DeleteFile(c *context.Context)

func DeleteFilePost added in v0.9.97

func DeleteFilePost(c *context.Context, f form.DeleteRepoFile)

func DeleteLabel added in v0.4.0

func DeleteLabel(c *context.Context)

func DeleteMilestone added in v0.6.5

func DeleteMilestone(c *context.Context)

func DeleteRelease added in v0.7.19

func DeleteRelease(c *context.Context)

func DeleteWebhook added in v0.6.9

func DeleteWebhook(c *context.Context)

func DeleteWikiPagePost added in v0.9.0

func DeleteWikiPagePost(c *context.Context)

func Diff

func Diff(c *context.Context)

func DiffPreviewPost added in v0.9.97

func DiffPreviewPost(c *context.Context, f form.EditPreviewDiff)

func DiscordHooksEditPost added in v0.10.1

func DiscordHooksEditPost(c *context.Context, f form.NewDiscordHook)

FIXME: merge logic to Slack

func DiscordHooksNewPost added in v0.10.1

func DiscordHooksNewPost(c *context.Context, f form.NewDiscordHook)

FIXME: merge logic to Slack

func Download added in v0.5.0

func Download(c *context.Context)

func EditFile added in v0.9.97

func EditFile(c *context.Context)

func EditFilePost added in v0.9.97

func EditFilePost(c *context.Context, f form.EditRepoFile)

func EditMilestone added in v0.6.5

func EditMilestone(c *context.Context)

func EditMilestonePost added in v0.6.5

func EditMilestonePost(c *context.Context, f form.CreateMilestone)

func EditRelease added in v0.5.0

func EditRelease(c *context.Context)

func EditReleasePost added in v0.5.0

func EditReleasePost(c *context.Context, f form.EditRelease)

func EditWiki added in v0.7.33

func EditWiki(c *context.Context)

func EditWikiPost added in v0.7.33

func EditWikiPost(c *context.Context, f form.NewWiki)

func FileHistory added in v0.4.0

func FileHistory(c *context.Context)

func Fork added in v0.5.8

func Fork(c *context.Context)

func ForkPost added in v0.5.8

func ForkPost(c *context.Context, f form.CreateRepo)

func Forks added in v0.7.0

func Forks(c *context.Context)

func HTTP added in v0.7.0

func HTTP(c *HTTPContext)

func HTTPContexter added in v0.10.1

func HTTPContexter() macaron.Handler

func Home added in v0.5.0

func Home(c *context.Context)

func InitializeLabels added in v0.9.97

func InitializeLabels(c *context.Context, f form.InitializeLabels)

func Issues

func Issues(c *context.Context)

func Labels added in v0.6.3

func Labels(c *context.Context)

func MergePullRequest added in v0.6.9

func MergePullRequest(c *context.Context)

func Migrate added in v0.3.0

func Migrate(c *context.Context)

func MigratePost added in v0.3.0

func MigratePost(c *context.Context, f form.MigrateRepo)

func Milestones added in v0.4.0

func Milestones(c *context.Context)

func MustAllowPulls added in v0.8.43

func MustAllowPulls(c *context.Context)

func MustBeNotBare added in v0.8.25

func MustBeNotBare(c *context.Context)

func MustEnableIssues added in v0.7.33

func MustEnableIssues(c *context.Context)

func MustEnableWiki added in v0.7.33

func MustEnableWiki(c *context.Context)

func NewComment added in v0.6.5

func NewComment(c *context.Context, f form.CreateComment)

func NewFile added in v0.9.97

func NewFile(c *context.Context)

func NewFilePost added in v0.9.97

func NewFilePost(c *context.Context, f form.EditRepoFile)

func NewIssue added in v0.6.5

func NewIssue(c *context.Context)

func NewIssuePost added in v0.6.5

func NewIssuePost(c *context.Context, f form.NewIssue)

func NewLabel added in v0.4.0

func NewLabel(c *context.Context, f form.CreateLabel)

func NewMilestone added in v0.4.0

func NewMilestone(c *context.Context)

func NewMilestonePost added in v0.4.0

func NewMilestonePost(c *context.Context, f form.CreateMilestone)

func NewRelease added in v0.5.0

func NewRelease(c *context.Context)

func NewReleasePost added in v0.5.0

func NewReleasePost(c *context.Context, f form.NewRelease)

func NewWiki added in v0.7.33

func NewWiki(c *context.Context)

func NewWikiPost added in v0.7.33

func NewWikiPost(c *context.Context, f form.NewWiki)

func ParseCompareInfo added in v0.6.9

func ParseCompareInfo(c *context.Context) (*models.User, *models.Repository, *git.Repository, *git.PullRequestInfo, string, string)

func ParseHookEvent added in v0.6.9

func ParseHookEvent(f form.Webhook) *models.HookEvent

func PrepareCompareDiff added in v0.6.9

func PrepareCompareDiff(
	c *context.Context,
	headUser *models.User,
	headRepo *models.Repository,
	headGitRepo *git.Repository,
	prInfo *git.PullRequestInfo,
	baseBranch, headBranch string) bool

func PrepareMergedViewPullInfo added in v0.6.9

func PrepareMergedViewPullInfo(c *context.Context, issue *models.Issue)

func PrepareViewPullInfo added in v0.6.9

func PrepareViewPullInfo(c *context.Context, issue *models.Issue) *git.PullRequestInfo

func Pulls

func Pulls(c *context.Context)

func RawDiff added in v0.9.46

func RawDiff(c *context.Context)

func RedeliveryWebhook added in v0.11.4

func RedeliveryWebhook(c *context.Context)

func RefCommits added in v0.5.8

func RefCommits(c *context.Context)

func Releases added in v0.3.0

func Releases(c *context.Context)

func RemoveUploadFileFromServer added in v0.9.97

func RemoveUploadFileFromServer(c *context.Context, f form.RemoveUploadFile)
func RenderIssueLinks(oldCommits *list.List, repoLink string) *list.List

func RenderUserCards added in v0.8.25

func RenderUserCards(c *context.Context, total int, getter func(page int) ([]*models.User, error), tpl string)

func RetrieveLabels added in v0.6.3

func RetrieveLabels(c *context.Context)

func RetrieveRepoMetas added in v0.6.9

func RetrieveRepoMetas(c *context.Context, repo *models.Repository) []*models.Label

func RetrieveRepoMilestonesAndAssignees added in v0.6.9

func RetrieveRepoMilestonesAndAssignees(c *context.Context, repo *models.Repository)

func SearchCommits added in v0.3.0

func SearchCommits(c *context.Context)

func ServeBlob added in v0.5.8

func ServeBlob(c *context.Context, blob *git.Blob) error

func ServeData added in v0.6.5

func ServeData(c *context.Context, name string, reader io.Reader) error

func Settings added in v0.5.0

func Settings(c *context.Context)

func SettingsBranches added in v0.10.1

func SettingsBranches(c *context.Context)

func SettingsCollaboration added in v0.5.0

func SettingsCollaboration(c *context.Context)

func SettingsCollaborationPost added in v0.10.1

func SettingsCollaborationPost(c *context.Context)

func SettingsDeployKeys added in v0.6.5

func SettingsDeployKeys(c *context.Context)

func SettingsDeployKeysPost added in v0.6.5

func SettingsDeployKeysPost(c *context.Context, f form.AddSSHKey)

func SettingsGitHooks added in v0.10.1

func SettingsGitHooks(c *context.Context)

func SettingsGitHooksEdit added in v0.10.1

func SettingsGitHooksEdit(c *context.Context)

func SettingsGitHooksEditPost added in v0.10.1

func SettingsGitHooksEditPost(c *context.Context)

func SettingsPost added in v0.5.0

func SettingsPost(c *context.Context, f form.RepoSetting)

func SettingsProtectedBranch added in v0.10.1

func SettingsProtectedBranch(c *context.Context)

func SettingsProtectedBranchPost added in v0.10.1

func SettingsProtectedBranchPost(c *context.Context, f form.ProtectBranch)

func SingleDownload

func SingleDownload(c *context.Context)

func SlackHooksEditPost added in v0.5.0

func SlackHooksEditPost(c *context.Context, f form.NewSlackHook)

func SlackHooksNewPost added in v0.5.0

func SlackHooksNewPost(c *context.Context, f form.NewSlackHook)

func Stars added in v0.7.0

func Stars(c *context.Context)

func TestWebhook added in v0.7.33

func TestWebhook(c *context.Context)

func TriggerTask added in v0.7.0

func TriggerTask(c *context.Context)

func UpdateCommentContent added in v0.6.9

func UpdateCommentContent(c *context.Context)

func UpdateDefaultBranch added in v0.10.1

func UpdateDefaultBranch(c *context.Context)

func UpdateIssueAssignee added in v0.6.5

func UpdateIssueAssignee(c *context.Context)

func UpdateIssueContent added in v0.6.9

func UpdateIssueContent(c *context.Context)

func UpdateIssueLabel added in v0.4.0

func UpdateIssueLabel(c *context.Context)

func UpdateIssueMilestone added in v0.4.0

func UpdateIssueMilestone(c *context.Context)

func UpdateIssueTitle added in v0.6.9

func UpdateIssueTitle(c *context.Context)

func UpdateLabel added in v0.4.0

func UpdateLabel(c *context.Context, f form.CreateLabel)

func UploadFile added in v0.9.97

func UploadFile(c *context.Context)

func UploadFilePost added in v0.9.97

func UploadFilePost(c *context.Context, f form.UploadRepoFile)

func UploadFileToServer added in v0.9.97

func UploadFileToServer(c *context.Context)

func UploadIssueAttachment added in v0.6.5

func UploadIssueAttachment(c *context.Context)

func UploadReleaseAttachment added in v0.10.18

func UploadReleaseAttachment(c *context.Context)

func ValidateRepoMetas added in v0.6.9

func ValidateRepoMetas(c *context.Context, f form.NewIssue) ([]int64, int64, int64)

func ViewIssue

func ViewIssue(c *context.Context)

func ViewPull added in v0.11.4

func ViewPull(c *context.Context)

func ViewPullCommits added in v0.6.9

func ViewPullCommits(c *context.Context)

func ViewPullFiles added in v0.6.9

func ViewPullFiles(c *context.Context)

func Watchers added in v0.7.0

func Watchers(c *context.Context)

func WebHooksEdit added in v0.4.0

func WebHooksEdit(c *context.Context)

func WebHooksEditPost added in v0.4.0

func WebHooksEditPost(c *context.Context, f form.NewWebhook)

func WebHooksNewPost added in v0.5.0

func WebHooksNewPost(c *context.Context, f form.NewWebhook)

func Webhooks added in v0.5.0

func Webhooks(c *context.Context)

func WebhooksNew added in v0.6.9

func WebhooksNew(c *context.Context)

func Wiki added in v0.7.33

func Wiki(c *context.Context)

func WikiPages added in v0.7.33

func WikiPages(c *context.Context)

Types

type Branch added in v0.10.18

type Branch struct {
	Name        string
	Commit      *git.Commit
	IsProtected bool
}

type ComposeHookEnvsOptions added in v0.10.1

type ComposeHookEnvsOptions struct {
	AuthUser  *models.User
	OwnerName string
	OwnerSalt string
	RepoID    int64
	RepoName  string
	RepoPath  string
}

type HTTPContext added in v0.10.1

type HTTPContext struct {
	*context.Context
	OwnerName string
	OwnerSalt string
	RepoID    int64
	RepoName  string
	AuthUser  *models.User
}

type OrgRepoCtx added in v0.5.0

type OrgRepoCtx struct {
	OrgID       int64
	RepoID      int64
	Link        string
	NewTemplate string
}

type PageMeta added in v0.7.33

type PageMeta struct {
	Name    string
	URL     string
	Updated time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL