repo

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileTypeForbidden not allowed file type error
	ErrFileTypeForbidden = errors.New("File type is not allowed")
	// ErrTooManyFiles upload too many files
	ErrTooManyFiles = errors.New("Maximum number of files to upload exceeded")
	// IssueTemplateCandidates issue templates
	IssueTemplateCandidates = []string{
		"ISSUE_TEMPLATE.md",
		"issue_template.md",
		".gitea/ISSUE_TEMPLATE.md",
		".gitea/issue_template.md",
		".github/ISSUE_TEMPLATE.md",
		".github/issue_template.md",
	}
)

Functions

func Action

func Action(ctx *context.Context)

Action response for actions to a repository

func Branches

func Branches(ctx *context.Context)

Branches render repository branch page

func ChangeCollaborationAccessMode

func ChangeCollaborationAccessMode(ctx *context.Context)

ChangeCollaborationAccessMode response for changing access of a collaboration

func ChangeMilestonStatus

func ChangeMilestonStatus(ctx *context.Context)

ChangeMilestonStatus response for change a milestone's status

func ChangeProtectedBranch added in v1.1.0

func ChangeProtectedBranch(ctx *context.Context)

ChangeProtectedBranch response for changing access of a protect branch

func CleanUpPullRequest added in v1.2.0

func CleanUpPullRequest(ctx *context.Context)

CleanUpPullRequest responses for delete merged branch when PR has been merged

func Collaboration

func Collaboration(ctx *context.Context)

Collaboration render a repository's collaboration page

func CollaborationPost

func CollaborationPost(ctx *context.Context)

CollaborationPost response for actions for a collaboration of a repository

func Commits

func Commits(ctx *context.Context)

Commits render branch's commits

func CompareAndPullRequest

func CompareAndPullRequest(ctx *context.Context)

CompareAndPullRequest render pull request preview page

func CompareAndPullRequestPost

func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)

CompareAndPullRequestPost response for creating pull request

func CompareDiff

func CompareDiff(ctx *context.Context)

CompareDiff show different from one commit to another commit

func Create

func Create(ctx *context.Context)

Create render creating repository page

func CreatePost

func CreatePost(ctx *context.Context, form auth.CreateRepoForm)

CreatePost response for creating repository

func DeleteCollaboration

func DeleteCollaboration(ctx *context.Context)

DeleteCollaboration delete a collaboration for a repository

func DeleteComment

func DeleteComment(ctx *context.Context)

DeleteComment delete comment of issue

func DeleteDeployKey

func DeleteDeployKey(ctx *context.Context)

DeleteDeployKey response for deleting a deploy key

func DeleteFile

func DeleteFile(ctx *context.Context)

DeleteFile render delete file page

func DeleteFilePost

func DeleteFilePost(ctx *context.Context, form auth.DeleteRepoFileForm)

DeleteFilePost response for deleting file

func DeleteLabel

func DeleteLabel(ctx *context.Context)

DeleteLabel delete a label

func DeleteMilestone

func DeleteMilestone(ctx *context.Context)

DeleteMilestone delete a milestone

func DeleteProtectedBranch added in v1.1.0

func DeleteProtectedBranch(ctx *context.Context)

DeleteProtectedBranch delete a protection for a branch of a repository

func DeleteRelease

func DeleteRelease(ctx *context.Context)

DeleteRelease delete a release

func DeleteWebhook

func DeleteWebhook(ctx *context.Context)

DeleteWebhook delete a webhook

func DeleteWikiPagePost

func DeleteWikiPagePost(ctx *context.Context)

DeleteWikiPagePost delete wiki page

func DeployKeys

func DeployKeys(ctx *context.Context)

DeployKeys render the deploy keys list of a repository page

func DeployKeysPost

func DeployKeysPost(ctx *context.Context, form auth.AddKeyForm)

DeployKeysPost response for adding a deploy key of a repository

func Diff

func Diff(ctx *context.Context)

Diff show different from current commit to previous commit

func DiffPreviewPost

func DiffPreviewPost(ctx *context.Context, form auth.EditPreviewDiffForm)

DiffPreviewPost render preview diff page

func Download

func Download(ctx *context.Context)

Download download an archive of a repository

func EditFile

func EditFile(ctx *context.Context)

EditFile render edit file page

func EditFilePost

func EditFilePost(ctx *context.Context, form auth.EditRepoFileForm)

EditFilePost response for editing file

func EditMilestone

func EditMilestone(ctx *context.Context)

EditMilestone render edting milestone page

func EditMilestonePost

func EditMilestonePost(ctx *context.Context, form auth.CreateMilestoneForm)

EditMilestonePost response for edting milestone

func EditRelease

func EditRelease(ctx *context.Context)

EditRelease render release edit page

func EditReleasePost

func EditReleasePost(ctx *context.Context, form auth.EditReleaseForm)

EditReleasePost response for edit release

func EditWiki

func EditWiki(ctx *context.Context)

EditWiki render wiki modify page

func EditWikiPost

func EditWikiPost(ctx *context.Context, form auth.NewWikiForm)

EditWikiPost response fro wiki modify request

func FileHistory

func FileHistory(ctx *context.Context)

FileHistory show a file's reversions

func Fork

func Fork(ctx *context.Context)

Fork render repository fork page

func ForkPost

func ForkPost(ctx *context.Context, form auth.CreateRepoForm)

ForkPost response for forking a repository

func Forks

func Forks(ctx *context.Context)

Forks render repository's forked users

func GitHooks

func GitHooks(ctx *context.Context)

GitHooks hooks of a repository

func GitHooksEdit

func GitHooksEdit(ctx *context.Context)

GitHooksEdit render for editing a hook of repository page

func GitHooksEditPost

func GitHooksEditPost(ctx *context.Context)

GitHooksEditPost response for editing a git hook of a repository

func GogsHooksEditPost added in v1.2.0

func GogsHooksEditPost(ctx *context.Context, form auth.NewGogshookForm)

GogsHooksEditPost response for editing gogs hook

func GogsHooksNewPost added in v1.2.0

func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm)

GogsHooksNewPost response for creating webhook

func Graph added in v1.1.0

func Graph(ctx *context.Context)

Graph render commit graph - show commits from all branches.

func HTTP

func HTTP(ctx *context.Context)

HTTP implmentation git smart HTTP protocol

func HTTPBackend

func HTTPBackend(ctx *context.Context, cfg *serviceConfig) http.HandlerFunc

HTTPBackend middleware for git smart HTTP protocol

func Home

func Home(ctx *context.Context)

Home render repository home page

func InitializeLabels

func InitializeLabels(ctx *context.Context, form auth.InitializeLabelsForm)

InitializeLabels init labels for a repository

func IssueWatch added in v1.2.0

func IssueWatch(c *context.Context)

IssueWatch sets issue watching

func Issues

func Issues(ctx *context.Context)

Issues render issues page

func Labels

func Labels(ctx *context.Context)

Labels render issue's labels page

func MergePullRequest

func MergePullRequest(ctx *context.Context)

MergePullRequest response for merging pull request

func Migrate

func Migrate(ctx *context.Context)

Migrate render migration of repository page

func MigratePost

func MigratePost(ctx *context.Context, form auth.MigrateRepoForm)

MigratePost response for migrating from external git repository

func Milestones

func Milestones(ctx *context.Context)

Milestones render milestones page

func MustAllowPulls

func MustAllowPulls(ctx *context.Context)

MustAllowPulls check if repository enable pull requests

func MustBeNotBare

func MustBeNotBare(ctx *context.Context)

MustBeNotBare render when a repo is a bare git dir

func MustEnableIssues

func MustEnableIssues(ctx *context.Context)

MustEnableIssues check if repository enable internal issues

func MustEnableWiki

func MustEnableWiki(ctx *context.Context)

MustEnableWiki check if wiki is enabled, if external then redirect

func NewComment

func NewComment(ctx *context.Context, form auth.CreateCommentForm)

NewComment create a comment for issue

func NewFile

func NewFile(ctx *context.Context)

NewFile render create file page

func NewFilePost

func NewFilePost(ctx *context.Context, form auth.EditRepoFileForm)

NewFilePost response for creating file

func NewIssue

func NewIssue(ctx *context.Context)

NewIssue render createing issue page

func NewIssuePost

func NewIssuePost(ctx *context.Context, form auth.CreateIssueForm)

NewIssuePost response for creating new issue

func NewLabel

func NewLabel(ctx *context.Context, form auth.CreateLabelForm)

NewLabel create new label for repository

func NewMilestone

func NewMilestone(ctx *context.Context)

NewMilestone render creating milestone page

func NewMilestonePost

func NewMilestonePost(ctx *context.Context, form auth.CreateMilestoneForm)

NewMilestonePost response for creating milestone

func NewRelease

func NewRelease(ctx *context.Context)

NewRelease render creating release page

func NewReleasePost

func NewReleasePost(ctx *context.Context, form auth.NewReleaseForm)

NewReleasePost response for creating a release

func NewWiki

func NewWiki(ctx *context.Context)

NewWiki render wiki create page

func NewWikiPost

func NewWikiPost(ctx *context.Context, form auth.NewWikiForm)

NewWikiPost response fro wiki create request

func ParseCompareInfo

ParseCompareInfo parse compare info between two commit for preparing pull request

func ParseHookEvent

func ParseHookEvent(form auth.WebhookForm) *models.HookEvent

ParseHookEvent convert web form content to models.HookEvent

func PrepareCompareDiff

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

PrepareCompareDiff render pull request preview diff page

func PrepareMergedViewPullInfo

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

PrepareMergedViewPullInfo show meta information for a merged pull request view page

func PrepareViewPullInfo

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

PrepareViewPullInfo show meta information for a pull request preview page

func ProtectedBranch added in v1.1.0

func ProtectedBranch(ctx *context.Context)

ProtectedBranch render the page to protect the repository

func ProtectedBranchPost added in v1.1.0

func ProtectedBranchPost(ctx *context.Context)

ProtectedBranchPost response for protect for a branch of a repository

func RawDiff

func RawDiff(ctx *context.Context)

RawDiff dumps diff results of repository in given commit ID to io.Writer

func RefCommits

func RefCommits(ctx *context.Context)

RefCommits render commits page

func Releases

func Releases(ctx *context.Context)

Releases render releases list page

func RemoveUploadFileFromServer

func RemoveUploadFileFromServer(ctx *context.Context, form auth.RemoveUploadFileForm)

RemoveUploadFileFromServer remove file from server file dir

func RenderUserCards

func RenderUserCards(ctx *context.Context, total int, getter func(page int) ([]*models.User, error), tpl base.TplName)

RenderUserCards render a page show users according the input templaet

func RetrieveLabels

func RetrieveLabels(ctx *context.Context)

RetrieveLabels find all the labels of a repository

func RetrieveRepoMetas

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

RetrieveRepoMetas find all the meta information of a repository

func RetrieveRepoMilestonesAndAssignees

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

RetrieveRepoMilestonesAndAssignees find all the milestones and assignees of a repository

func SearchCommits

func SearchCommits(ctx *context.Context)

SearchCommits render commits filtered by keyword

func ServeBlob

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

ServeBlob download a git.Blob

func ServeData

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

ServeData download file from io.Reader

func SetDiffViewStyle added in v1.0.0

func SetDiffViewStyle(ctx *context.Context)

SetDiffViewStyle set diff style as render variable

func SetEditorconfigIfExists added in v1.0.0

func SetEditorconfigIfExists(ctx *context.Context)

SetEditorconfigIfExists set editor config as render variable

func Settings

func Settings(ctx *context.Context)

Settings show a repository's settings page

func SettingsPost

func SettingsPost(ctx *context.Context, form auth.RepoSettingForm)

SettingsPost response for changes of a repository

func SingleDownload

func SingleDownload(ctx *context.Context)

SingleDownload download a file by repos path

func SlackHooksEditPost

func SlackHooksEditPost(ctx *context.Context, form auth.NewSlackHookForm)

SlackHooksEditPost response for editing slack hook

func SlackHooksNewPost

func SlackHooksNewPost(ctx *context.Context, form auth.NewSlackHookForm)

SlackHooksNewPost response for creating slack hook

func Stars

func Stars(ctx *context.Context)

Stars render repository's starred users

func TestWebhook

func TestWebhook(ctx *context.Context)

TestWebhook test if web hook is work fine

func TriggerTask

func TriggerTask(ctx *context.Context)

TriggerTask response for a trigger task request

func UpdateCommentContent

func UpdateCommentContent(ctx *context.Context)

UpdateCommentContent change comment of issue's content

func UpdateIssueAssignee

func UpdateIssueAssignee(ctx *context.Context)

UpdateIssueAssignee change issue's assignee

func UpdateIssueContent

func UpdateIssueContent(ctx *context.Context)

UpdateIssueContent change issue's content

func UpdateIssueLabel

func UpdateIssueLabel(ctx *context.Context)

UpdateIssueLabel change issue's labels

func UpdateIssueMilestone

func UpdateIssueMilestone(ctx *context.Context)

UpdateIssueMilestone change issue's milestone

func UpdateIssueStatus added in v1.2.0

func UpdateIssueStatus(ctx *context.Context)

UpdateIssueStatus change issue's status

func UpdateIssueTitle

func UpdateIssueTitle(ctx *context.Context)

UpdateIssueTitle change issue's title

func UpdateLabel

func UpdateLabel(ctx *context.Context, form auth.CreateLabelForm)

UpdateLabel update a label's name and color

func UploadAttachment added in v1.1.0

func UploadAttachment(ctx *context.Context)

UploadAttachment response for uploading issue's attachment

func UploadFile

func UploadFile(ctx *context.Context)

UploadFile render upload file page

func UploadFilePost

func UploadFilePost(ctx *context.Context, form auth.UploadRepoFileForm)

UploadFilePost response for uploading file

func UploadFileToServer

func UploadFileToServer(ctx *context.Context)

UploadFileToServer upload file to server file dir not git

func ValidateRepoMetas

func ValidateRepoMetas(ctx *context.Context, form auth.CreateIssueForm) ([]int64, int64, int64)

ValidateRepoMetas check and returns repository's meta informations

func ViewIssue

func ViewIssue(ctx *context.Context)

ViewIssue render issue view page

func ViewPullCommits

func ViewPullCommits(ctx *context.Context)

ViewPullCommits show commits for a pull request

func ViewPullFiles

func ViewPullFiles(ctx *context.Context)

ViewPullFiles render pull request changed files list page

func Watchers

func Watchers(ctx *context.Context)

Watchers render repository's watch users

func WebHooksEdit

func WebHooksEdit(ctx *context.Context)

WebHooksEdit render editing web hook page

func WebHooksEditPost

func WebHooksEditPost(ctx *context.Context, form auth.NewWebhookForm)

WebHooksEditPost response for editing web hook

func WebHooksNewPost

func WebHooksNewPost(ctx *context.Context, form auth.NewWebhookForm)

WebHooksNewPost response for creating webhook

func Webhooks

func Webhooks(ctx *context.Context)

Webhooks render web hooks list page

func WebhooksNew

func WebhooksNew(ctx *context.Context)

WebhooksNew render creating webhook page

func Wiki

func Wiki(ctx *context.Context)

Wiki renders single wiki page

func WikiPages

func WikiPages(ctx *context.Context)

WikiPages render wiki pages list page

func WikiRaw added in v1.1.0

func WikiRaw(ctx *context.Context)

WikiRaw outputs raw blob requested by user (image for example)

Types

type PageMeta

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

PageMeta wiki page meat information

Jump to

Keyboard shortcuts

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