# Functions
AccessLogger returns a middleware to log access logger.
APIContexter returns apicontext as middleware.
CanEnableEditor checks if the user is allowed to write to the branch of the repo.
CheckRepoScopedToken check whether personal access token has repo scope.
ComposeGoGetImport returns go-get-import meta content.
Contexter initializes a classic context for a request.
EarlyResponseForGoGetMeta responses appropriate go-get meta with status 200 if user does not have actual access to the requested repository, or the owner or repository does not exist at all.
GenerateCsrfToken returns a URL-safe secure XSRF token that expires in CsrfTokenTimeout hours.
GetAPIContext returns a context for API routes.
GetImageCaptcha returns global image captcha.
GetPrivateContext returns a context for Private routes.
GetQueryBeforeSince return parsed time (unix format) from URL query's before and since.
GetValidateContext gets a context for middleware form validation.
GitHookService checks if repository Git hooks service has been enabled.
HandleOrgAssignment handles organization assignment.
NewPagination creates a new instance of the Pagination struct.
OrgAssignment returns a middleware to handle organization assignment.
OverrideContext overrides the underlying request context for Done() etc.
PackageAssignment returns a middleware to handle Context.Package assignment.
PackageAssignmentAPI returns a middleware to handle Context.Package assignment.
PackageContexter initializes a package context for a request.
PrivateContexter returns apicontext as middleware.
RedirectToRepo redirect to a differently-named repository.
RedirectToUser redirect to a differently-named user.
ReferencesGitRepo injects the GitRepo into the Context you can optional skip the IsEmpty check.
RepoAssignment returns a middleware to handle repository assignment.
RepoMustNotBeArchived checks if a repo is archived.
RepoRef handles repository reference names when the ref name is not explicitly given.
RepoRefByType handles repository reference name for a specific type of repository reference.
RepoRefForAPI handles repository reference names when the ref name is not explicitly given.
RequireRepoAdmin returns a middleware for requiring repository admin permission.
RequireRepoReader returns a middleware for requiring repository read to the specify unitType.
RequireRepoReaderOr returns a middleware for requiring repository write to one of the unit permission.
RequireRepoWriter returns a middleware for requiring repository write to the specify unitType.
RequireRepoWriterOr returns a middleware for requiring repository write to one of the unit permission.
RetrieveBaseRepo retrieves base repository.
RetrieveTemplateRepo retrieves template repository used to generate this repository.
SetCaptchaData sets common captcha data.
UserAssignmentAPI returns a middleware to handle context-user assignment for api routes.
UserAssignmentWeb returns a middleware to handle context-user assignment for web routes.
UserIDAssignmentAPI returns a middleware to handle context-user assignment for api routes.
ValidCsrfToken returns true if token is a valid and unexpired token returned by Generate.
VerifyCaptcha verifies Captcha data No-op if captchas are not enabled.
# Constants
CsrfTokenTimeout represents the duration that XSRF tokens are valid.
RepoRefUnknown is for legacy support, makes the code to "guess" the ref type.
# Variables
CsrfTokenRegenerationInterval is the interval between token generations, old tokens are still valid before CsrfTokenTimeout.
# Structs
APIConflict is a conflict empty response swagger:response conflict.
APIContext is a specific context for API service.
APIEmpty is an empty response swagger:response empty.
APIError is error format response swagger:response error.
APIForbiddenError is a forbidden error response swagger:response forbidden.
APIInvalidTopicsError is error format response to invalid topics swagger:response invalidTopicsError.
APINotFound is a not found empty response swagger:response notFound.
APIOrganization contains organization and team.
APIRedirect is a redirect response swagger:response redirect.
APIRepoArchivedError is an error that is raised when an archived repo should be modified swagger:response repoArchivedError.
APIValidationError is error format response related to input validation swagger:response validationError.
CanCommitToBranchResults represents the results of CanCommitToBranch.
Context represents context of a request.
CsrfOptions maintains options to manage behavior of Generate.
Organization contains organization context.
Package contains owner, access mode and optional the package descriptor.
Pagination provides a pagination via paginator.Paginator and additional configurations for the link params used in rendering.
PrivateContext represents a context for private routes.
PullRequest contains information to make a pull request.
Repository contains information to operate a repository.
Response represents a response.
ValidateContext is a special context for form validation middleware.
# Interfaces
CSRFProtector represents a CSRF protector and is used to get the current token and validate the token.
Render represents a template render.
ResponseWriter represents a response writer for HTTP.
# Type aliases
APIString is a string response swagger:response string.
RepoRefType type of repo reference.