repo

package
v0.11.43 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2018 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

func AllBranches(c *context.Context)

func Branches

func Branches(c *context.Context)

func ChangeCollaborationAccessMode

func ChangeCollaborationAccessMode(c *context.Context)

func ChangeMilestonStatus

func ChangeMilestonStatus(c *context.Context)

func Commits

func Commits(c *context.Context)

func CompareAndPullRequest

func CompareAndPullRequest(c *context.Context)

func CompareAndPullRequestPost

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

func CompareDiff

func CompareDiff(c *context.Context)

func ComposeHookEnvs

func ComposeHookEnvs(opts ComposeHookEnvsOptions) []string

func Create

func Create(c *context.Context)

func CreatePost

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

func DeleteBranchPost

func DeleteBranchPost(c *context.Context)

func DeleteCollaboration

func DeleteCollaboration(c *context.Context)

func DeleteComment

func DeleteComment(c *context.Context)

func DeleteDeployKey

func DeleteDeployKey(c *context.Context)

func DeleteFile

func DeleteFile(c *context.Context)

func DeleteFilePost

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

func DeleteLabel

func DeleteLabel(c *context.Context)

func DeleteMilestone

func DeleteMilestone(c *context.Context)

func DeleteRelease

func DeleteRelease(c *context.Context)

func DeleteWebhook

func DeleteWebhook(c *context.Context)

func DeleteWikiPagePost

func DeleteWikiPagePost(c *context.Context)

func Diff

func Diff(c *context.Context)

func DiffPreviewPost

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

func DingtalkHooksEditPost added in v0.11.33

func DingtalkHooksEditPost(c *context.Context, f form.NewDingtalkHook)

func DingtalkHooksNewPost added in v0.11.33

func DingtalkHooksNewPost(c *context.Context, f form.NewDingtalkHook)

func DiscordHooksEditPost

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

FIXME: merge logic to Slack

func DiscordHooksNewPost

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

FIXME: merge logic to Slack

func Download

func Download(c *context.Context)

func EditFile

func EditFile(c *context.Context)

func EditFilePost

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

func EditMilestone

func EditMilestone(c *context.Context)

func EditMilestonePost

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

func EditRelease

func EditRelease(c *context.Context)

func EditReleasePost

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

func EditWiki

func EditWiki(c *context.Context)

func EditWikiPost

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

func FileHistory

func FileHistory(c *context.Context)

func Fork

func Fork(c *context.Context)

func ForkPost

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

func Forks

func Forks(c *context.Context)

func HTTP

func HTTP(c *HTTPContext)

func HTTPContexter

func HTTPContexter() macaron.Handler

func Home

func Home(c *context.Context)

func InitializeLabels

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

func Issues

func Issues(c *context.Context)

func Labels

func Labels(c *context.Context)

func MergePullRequest

func MergePullRequest(c *context.Context)

func Migrate

func Migrate(c *context.Context)

func MigratePost

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

func Milestones

func Milestones(c *context.Context)

func MustAllowPulls

func MustAllowPulls(c *context.Context)

func MustBeNotBare

func MustBeNotBare(c *context.Context)

func MustEnableIssues

func MustEnableIssues(c *context.Context)

func MustEnableWiki

func MustEnableWiki(c *context.Context)

func NewComment

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

func NewFile

func NewFile(c *context.Context)

func NewFilePost

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

func NewIssue

func NewIssue(c *context.Context)

func NewIssuePost

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

func NewLabel

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

func NewMilestone

func NewMilestone(c *context.Context)

func NewMilestonePost

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

func NewRelease

func NewRelease(c *context.Context)

func NewReleasePost

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

func NewWiki

func NewWiki(c *context.Context)

func NewWikiPost

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

func ParseCompareInfo

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

func ParseHookEvent

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

func PrepareCompareDiff

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

func PrepareMergedViewPullInfo

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

func PrepareViewPullInfo

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

func Pulls

func Pulls(c *context.Context)

func RawDiff

func RawDiff(c *context.Context)

func RedeliveryWebhook

func RedeliveryWebhook(c *context.Context)

func RefCommits

func RefCommits(c *context.Context)

func Releases

func Releases(c *context.Context)

func RemoveUploadFileFromServer

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

func RenderUserCards

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

func RetrieveLabels

func RetrieveLabels(c *context.Context)

func RetrieveRepoMetas

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

func RetrieveRepoMilestonesAndAssignees

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

func SearchCommits

func SearchCommits(c *context.Context)

func ServeBlob

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

func ServeData

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

func Settings

func Settings(c *context.Context)

func SettingsBranches

func SettingsBranches(c *context.Context)

func SettingsCollaboration

func SettingsCollaboration(c *context.Context)

func SettingsCollaborationPost

func SettingsCollaborationPost(c *context.Context)

func SettingsDeployKeys

func SettingsDeployKeys(c *context.Context)

func SettingsDeployKeysPost

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

func SettingsGitHooks

func SettingsGitHooks(c *context.Context)

func SettingsGitHooksEdit

func SettingsGitHooksEdit(c *context.Context)

func SettingsGitHooksEditPost

func SettingsGitHooksEditPost(c *context.Context)

func SettingsPost

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

func SettingsProtectedBranch

func SettingsProtectedBranch(c *context.Context)

func SettingsProtectedBranchPost

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

func SingleDownload

func SingleDownload(c *context.Context)

func SlackHooksEditPost

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

func SlackHooksNewPost

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

func Stars

func Stars(c *context.Context)

func TestWebhook

func TestWebhook(c *context.Context)

func TriggerTask

func TriggerTask(c *context.Context)

func UpdateCommentContent

func UpdateCommentContent(c *context.Context)

func UpdateDefaultBranch

func UpdateDefaultBranch(c *context.Context)

func UpdateIssueAssignee

func UpdateIssueAssignee(c *context.Context)

func UpdateIssueContent

func UpdateIssueContent(c *context.Context)

func UpdateIssueLabel

func UpdateIssueLabel(c *context.Context)

func UpdateIssueMilestone

func UpdateIssueMilestone(c *context.Context)

func UpdateIssueTitle

func UpdateIssueTitle(c *context.Context)

func UpdateLabel

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

func UploadFile

func UploadFile(c *context.Context)

func UploadFilePost

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

func UploadFileToServer

func UploadFileToServer(c *context.Context)

func UploadIssueAttachment

func UploadIssueAttachment(c *context.Context)

func UploadReleaseAttachment

func UploadReleaseAttachment(c *context.Context)

func ValidateRepoMetas

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

func ViewIssue

func ViewIssue(c *context.Context)

func ViewPull

func ViewPull(c *context.Context)

func ViewPullCommits

func ViewPullCommits(c *context.Context)

func ViewPullFiles

func ViewPullFiles(c *context.Context)

func Watchers

func Watchers(c *context.Context)

func WebHooksEdit

func WebHooksEdit(c *context.Context)

func WebHooksEditPost

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

func WebHooksNewPost

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

func Webhooks

func Webhooks(c *context.Context)

func WebhooksNew

func WebhooksNew(c *context.Context)

func Wiki

func Wiki(c *context.Context)

func WikiPages

func WikiPages(c *context.Context)

Types

type Branch

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

type ComposeHookEnvsOptions

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

type HTTPContext

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

type OrgRepoCtx

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

type PageMeta

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