Documentation ¶
Index ¶
- Constants
- func IsEmailDomainListed(globs []glob.Glob, email string) bool
- func IsUserHiddenCommentTypeGroupChecked(group string, hiddenCommentTypes *big.Int) (ret bool)
- func ParseRemoteAddr(remoteAddr, authUsername, authPassword string) (string, error)
- func UserHiddenCommentTypesFromRequest(ctx *context.Context) *big.Int
- type AccessTokenForm
- type AddEmailForm
- type AddKeyForm
- type AddOpenIDForm
- type AddSecretForm
- type AddTimeManuallyForm
- type AdminCreateUserForm
- type AdminDashboardForm
- type AdminEditUserForm
- type AuthenticationForm
- type AuthorizationForm
- type AvatarForm
- type ChangePasswordForm
- type CherryPickForm
- type CodeCommentForm
- type ConnectOpenIDForm
- type CreateCommentForm
- type CreateIssueForm
- type CreateLabelForm
- type CreateMilestoneForm
- type CreateOrgForm
- type CreateProjectForm
- type CreateRepoForm
- type CreateTeamForm
- type DeadlineForm
- type DeleteRepoFileForm
- type DismissReviewForm
- type EditOAuth2ApplicationForm
- type EditPreviewDiffForm
- type EditProjectBoardForm
- type EditReleaseForm
- type EditRepoFileForm
- type EditRunnerForm
- type GrantApplicationForm
- type InitializeLabelsForm
- type InstallForm
- type IntrospectTokenForm
- type IssueLockForm
- type MergePullRequestForm
- type MigrateRepoForm
- type MustChangePasswordForm
- type NewAccessTokenForm
- type NewBranchForm
- type NewDingtalkHookForm
- type NewDiscordHookForm
- type NewFeishuHookForm
- type NewGogshookForm
- type NewMSTeamsHookForm
- type NewMatrixHookForm
- type NewPackagistHookForm
- type NewReleaseForm
- type NewSlackHookForm
- type NewTelegramHookForm
- type NewWebhookForm
- type NewWechatWorkHookForm
- type NewWikiForm
- type PackageCleanupRuleForm
- type PackageSettingForm
- type ProtectBranchForm
- type ProtectTagForm
- type ReactionForm
- type RegisterForm
- type RemoveUploadFileForm
- type RenameBranchForm
- type RepoSettingForm
- type SaveTopicForm
- type SignInForm
- type SignInOpenIDForm
- type SignUpOpenIDForm
- type SubmitReviewForm
- type TwoFactorAuthForm
- type TwoFactorScratchAuthForm
- type UpdateAllowEditsForm
- type UpdateLanguageForm
- type UpdateOrgSettingForm
- type UpdateProfileForm
- type UpdateThemeForm
- type UploadRepoFileForm
- type UserCreateProjectForm
- type WebauthnDeleteForm
- type WebauthnRegistrationForm
- type WebhookForm
Constants ¶
const ( AvatarLocal string = "local" AvatarByMail string = "bymail" )
Avatar types
Variables ¶
This section is empty.
Functions ¶
func IsEmailDomainListed ¶
IsEmailDomainListed checks whether the domain of an email address matches a list of domains
func IsUserHiddenCommentTypeGroupChecked ¶ added in v1.17.0
IsUserHiddenCommentTypeGroupChecked check whether a hidden comment type group is "enabled" (checked on UI)
func ParseRemoteAddr ¶
ParseRemoteAddr checks if given remote address is valid, and returns composed URL with needed username and password.
Types ¶
type AccessTokenForm ¶
type AccessTokenForm struct { GrantType string `json:"grant_type"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` RedirectURI string `json:"redirect_uri"` Code string `json:"code"` RefreshToken string `json:"refresh_token"` // PKCE support CodeVerifier string `json:"code_verifier"` }
AccessTokenForm for issuing access tokens from authorization codes or refresh tokens
type AddEmailForm ¶
type AddEmailForm struct {
Email string `binding:"Required;Email;MaxSize(254)"`
}
AddEmailForm form for adding new email
type AddKeyForm ¶
type AddKeyForm struct { Type string `binding:"OmitEmpty"` Title string `binding:"Required;MaxSize(50)"` Content string `binding:"Required"` Signature string `binding:"OmitEmpty"` KeyID string `binding:"OmitEmpty"` Fingerprint string `binding:"OmitEmpty"` IsWritable bool }
AddKeyForm form for adding SSH/GPG key
type AddOpenIDForm ¶
type AddOpenIDForm struct {
Openid string `binding:"Required;MaxSize(256)"`
}
AddOpenIDForm is for changing openid uri
type AddSecretForm ¶ added in v1.17.4
type AddSecretForm struct { Title string `binding:"Required;MaxSize(50)"` Content string `binding:"Required"` }
AddSecretForm for adding secrets
type AddTimeManuallyForm ¶
type AddTimeManuallyForm struct { Hours int `binding:"Range(0,1000)"` Minutes int `binding:"Range(0,1000)"` }
AddTimeManuallyForm form that adds spent time manually.
type AdminCreateUserForm ¶
type AdminCreateUserForm struct { LoginType string `binding:"Required"` LoginName string UserName string `binding:"Required;Username;MaxSize(40)"` Email string `binding:"Required;Email;MaxSize(254)"` Password string `binding:"MaxSize(255)"` SendNotify bool MustChangePassword bool Visibility structs.VisibleType }
AdminCreateUserForm form for admin to create user
type AdminDashboardForm ¶
AdminDashboardForm form for admin dashboard operations
type AdminEditUserForm ¶
type AdminEditUserForm struct { LoginType string `binding:"Required"` UserName string `binding:"Username;MaxSize(40)"` LoginName string FullName string `binding:"MaxSize(100)"` Email string `binding:"Required;Email;MaxSize(254)"` Password string `binding:"MaxSize(255)"` Website string `binding:"ValidUrl;MaxSize(255)"` Location string `binding:"MaxSize(50)"` MaxRepoCreation int Active bool Admin bool Restricted bool AllowGitHook bool AllowImportLocal bool AllowCreateOrganization bool ProhibitLogin bool Reset2FA bool `form:"reset_2fa"` Visibility structs.VisibleType }
AdminEditUserForm form for admin to create user
type AuthenticationForm ¶
type AuthenticationForm struct { ID int64 Type int `binding:"Range(2,7)"` Name string `binding:"Required;MaxSize(30)"` Host string Port int BindDN string BindPassword string UserBase string UserDN string AttributeUsername string AttributeName string AttributeSurname string AttributeMail string AttributeSSHPublicKey string AttributeAvatar string AttributesInBind bool UsePagedSearch bool SearchPageSize int Filter string AdminFilter string GroupsEnabled bool GroupDN string GroupFilter string GroupMemberUID string UserUID string RestrictedFilter string AllowDeactivateAll bool IsActive bool IsSyncEnabled bool SMTPAuth string SMTPHost string SMTPPort int AllowedDomains string SecurityProtocol int `binding:"Range(0,2)"` TLS bool SkipVerify bool HeloHostname string DisableHelo bool ForceSMTPS bool PAMServiceName string PAMEmailDomain string Oauth2Provider string Oauth2Key string Oauth2Secret string OpenIDConnectAutoDiscoveryURL string Oauth2UseCustomURL bool Oauth2TokenURL string Oauth2AuthURL string Oauth2ProfileURL string Oauth2EmailURL string Oauth2IconURL string Oauth2Tenant string Oauth2Scopes string Oauth2RequiredClaimName string Oauth2RequiredClaimValue string Oauth2GroupClaimName string Oauth2AdminGroup string Oauth2RestrictedGroup string Oauth2GroupTeamMap string `binding:"ValidGroupTeamMap"` Oauth2GroupTeamMapRemoval bool SkipLocalTwoFA bool SSPIAutoCreateUsers bool SSPIAutoActivateUsers bool SSPIStripDomainNames bool SSPISeparatorReplacement string `binding:"AlphaDashDot;MaxSize(5)"` SSPIDefaultLanguage string GroupTeamMap string `binding:"ValidGroupTeamMap"` GroupTeamMapRemoval bool }
AuthenticationForm form for authentication
type AuthorizationForm ¶
type AuthorizationForm struct { ResponseType string `binding:"Required;In(code)"` ClientID string `binding:"Required"` RedirectURI string State string Scope string Nonce string // PKCE support CodeChallengeMethod string // S256, plain CodeChallenge string }
AuthorizationForm form for authorizing oauth2 clients
type AvatarForm ¶
type AvatarForm struct { Source string Avatar *multipart.FileHeader Gravatar string `binding:"OmitEmpty;Email;MaxSize(254)"` Federavatar bool }
AvatarForm form for changing avatar
type ChangePasswordForm ¶
type ChangePasswordForm struct { OldPassword string `form:"old_password" binding:"MaxSize(255)"` Password string `form:"password" binding:"Required;MaxSize(255)"` Retype string `form:"retype"` }
ChangePasswordForm form for changing password
type CherryPickForm ¶ added in v1.17.0
type CherryPickForm struct { CommitSummary string `binding:"MaxSize(100)"` CommitMessage string CommitChoice string `binding:"Required;MaxSize(50)"` NewBranchName string `binding:"GitRefName;MaxSize(100)"` LastCommit string Revert bool Signoff bool }
CherryPickForm form for changing repository file
type CodeCommentForm ¶
type CodeCommentForm struct { Origin string `binding:"Required;In(timeline,diff)"` Content string `binding:"Required"` Side string `binding:"Required;In(previous,proposed)"` Line int64 TreePath string `form:"path" binding:"Required"` SingleReview bool `form:"single_review"` Reply int64 `form:"reply"` LatestCommitID string }
CodeCommentForm form for adding code comments for PRs
type ConnectOpenIDForm ¶
type ConnectOpenIDForm struct { UserName string `binding:"Required;MaxSize(254)"` Password string `binding:"Required;MaxSize(255)"` }
ConnectOpenIDForm form for connecting an existing account to an OpenID URI
type CreateCommentForm ¶
type CreateCommentForm struct { Content string Status string `binding:"OmitEmpty;In(reopen,close)"` Files []string }
CreateCommentForm form for creating comment
type CreateIssueForm ¶
type CreateIssueForm struct { Title string `binding:"Required;MaxSize(255)"` LabelIDs string `form:"label_ids"` AssigneeIDs string `form:"assignee_ids"` Ref string `form:"ref"` MilestoneID int64 ProjectID int64 AssigneeID int64 Content string Files []string AllowMaintainerEdit bool }
CreateIssueForm form for creating issue
type CreateLabelForm ¶
type CreateLabelForm struct { ID int64 Title string `binding:"Required;MaxSize(50)" locale:"repo.issues.label_title"` Exclusive bool `form:"exclusive"` Description string `binding:"MaxSize(200)" locale:"repo.issues.label_description"` Color string `binding:"Required;MaxSize(7)" locale:"repo.issues.label_color"` }
CreateLabelForm form for creating label
type CreateMilestoneForm ¶
type CreateMilestoneForm struct { Title string `binding:"Required;MaxSize(50)"` Content string Deadline string }
CreateMilestoneForm form for creating milestone
type CreateOrgForm ¶
type CreateOrgForm struct { OrgName string `binding:"Required;Username;MaxSize(40)" locale:"org.org_name_holder"` Visibility structs.VisibleType RepoAdminChangeTeamAccess bool }
CreateOrgForm form for creating organization
type CreateProjectForm ¶
type CreateProjectForm struct { Title string `binding:"Required;MaxSize(100)"` Content string BoardType project_model.BoardType CardType project_model.CardType }
CreateProjectForm form for creating a project
type CreateRepoForm ¶
type CreateRepoForm struct { UID int64 `binding:"Required"` RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` Private bool Description string `binding:"MaxSize(2048)"` DefaultBranch string `binding:"GitRefName;MaxSize(100)"` AutoInit bool Gitignores string IssueLabels string License string Readme string Template bool RepoTemplate int64 GitContent bool Topics bool GitHooks bool Webhooks bool Avatar bool Labels bool TrustModel string }
CreateRepoForm form for creating repository
type CreateTeamForm ¶
type CreateTeamForm struct { TeamName string `binding:"Required;AlphaDashDot;MaxSize(30)"` Description string `binding:"MaxSize(255)"` Permission string RepoAccess string CanCreateOrgRepo bool }
CreateTeamForm form for creating team
type DeadlineForm ¶
type DeadlineForm struct {
DateString string `form:"date" binding:"Required;Size(10)"`
}
DeadlineForm hold the validation rules for deadlines
type DeleteRepoFileForm ¶
type DeleteRepoFileForm struct { CommitSummary string `binding:"MaxSize(100)"` CommitMessage string CommitChoice string `binding:"Required;MaxSize(50)"` NewBranchName string `binding:"GitRefName;MaxSize(100)"` LastCommit string Signoff bool }
DeleteRepoFileForm form for deleting repository file
type DismissReviewForm ¶
DismissReviewForm for dismissing stale review by repo admin
type EditOAuth2ApplicationForm ¶
type EditOAuth2ApplicationForm struct { Name string `binding:"Required;MaxSize(255)" form:"application_name"` RedirectURIs string `binding:"Required" form:"redirect_uris"` ConfidentialClient bool `form:"confidential_client"` }
EditOAuth2ApplicationForm form for editing oauth2 applications
type EditPreviewDiffForm ¶
type EditPreviewDiffForm struct {
Content string
}
EditPreviewDiffForm form for changing preview diff
type EditProjectBoardForm ¶
type EditProjectBoardForm struct { Title string `binding:"Required;MaxSize(100)"` Sorting int8 Color string `binding:"MaxSize(7)"` }
EditProjectBoardForm is a form for editing a project board
type EditReleaseForm ¶
type EditReleaseForm struct { Title string `form:"title" binding:"Required;MaxSize(255)"` Content string `form:"content"` Draft string `form:"draft"` Prerelease bool `form:"prerelease"` Files []string }
EditReleaseForm form for changing release
type EditRepoFileForm ¶
type EditRepoFileForm struct { TreePath string `binding:"Required;MaxSize(500)"` Content string CommitSummary string `binding:"MaxSize(100)"` CommitMessage string CommitChoice string `binding:"Required;MaxSize(50)"` NewBranchName string `binding:"GitRefName;MaxSize(100)"` LastCommit string Signoff bool }
EditRepoFileForm form for changing repository file
type EditRunnerForm ¶ added in v1.19.0
EditRunnerForm form for admin to create runner
type GrantApplicationForm ¶
type GrantApplicationForm struct { ClientID string `binding:"Required"` RedirectURI string State string Scope string Nonce string }
GrantApplicationForm form for authorizing oauth2 clients
type InitializeLabelsForm ¶
type InitializeLabelsForm struct {
TemplateName string `binding:"Required"`
}
InitializeLabelsForm form for initializing labels
type InstallForm ¶
type InstallForm struct { DbType string `binding:"Required"` DbHost string DbUser string DbPasswd string DbName string SSLMode string Charset string `binding:"Required;In(utf8,utf8mb4)"` DbPath string DbSchema string AppName string `binding:"Required" locale:"install.app_name"` RepoRootPath string `binding:"Required"` LFSRootPath string RunUser string `binding:"Required"` Domain string `binding:"Required"` SSHPort int HTTPPort string `binding:"Required"` AppURL string `binding:"Required"` LogRootPath string `binding:"Required"` SMTPAddr string SMTPPort string SMTPFrom string SMTPUser string `binding:"OmitEmpty;MaxSize(254)" locale:"install.mailer_user"` SMTPPasswd string RegisterConfirm bool MailNotify bool OfflineMode bool DisableGravatar bool EnableFederatedAvatar bool EnableOpenIDSignIn bool EnableOpenIDSignUp bool DisableRegistration bool AllowOnlyExternalRegistration bool EnableCaptcha bool RequireSignInView bool DefaultKeepEmailPrivate bool DefaultAllowCreateOrganization bool DefaultEnableTimetracking bool EnableUpdateChecker bool NoReplyAddress string PasswordAlgorithm string AdminName string `binding:"OmitEmpty;Username;MaxSize(30)" locale:"install.admin_name"` AdminPasswd string `binding:"OmitEmpty;MaxSize(255)" locale:"install.admin_password"` AdminConfirmPasswd string AdminEmail string `binding:"OmitEmpty;MinSize(3);MaxSize(254);Include(@)" locale:"install.admin_email"` // ReinstallConfirmFirst we can not use 1/2/3 or A/B/C here, there is a framework bug, can not parse "reinstall_confirm_1" or "reinstall_confirm_a" ReinstallConfirmFirst bool ReinstallConfirmSecond bool ReinstallConfirmThird bool }
InstallForm form for installation page
type IntrospectTokenForm ¶ added in v1.16.0
type IntrospectTokenForm struct {
Token string `json:"token"`
}
IntrospectTokenForm for introspecting tokens
type IssueLockForm ¶
type IssueLockForm struct {
Reason string `binding:"Required"`
}
IssueLockForm form for locking an issue
func (IssueLockForm) HasValidReason ¶
func (i IssueLockForm) HasValidReason() bool
HasValidReason checks to make sure that the reason submitted in the form matches any of the values in the config
type MergePullRequestForm ¶
type MergePullRequestForm struct { // required: true // enum: merge,rebase,rebase-merge,squash,manually-merged Do string `binding:"Required;In(merge,rebase,rebase-merge,squash,manually-merged)"` MergeTitleField string MergeMessageField string MergeCommitID string // only used for manually-merged HeadCommitID string `json:"head_commit_id,omitempty"` ForceMerge bool `json:"force_merge,omitempty"` MergeWhenChecksSucceed bool `json:"merge_when_checks_succeed,omitempty"` DeleteBranchAfterMerge bool `json:"delete_branch_after_merge,omitempty"` }
MergePullRequestForm form for merging Pull Request swagger:model MergePullRequestOption
type MigrateRepoForm ¶
type MigrateRepoForm struct { // required: true CloneAddr string `json:"clone_addr" binding:"Required"` Service structs.GitServiceType `json:"service"` AuthUsername string `json:"auth_username"` AuthPassword string `json:"auth_password"` AuthToken string `json:"auth_token"` // required: true UID int64 `json:"uid" binding:"Required"` // required: true RepoName string `json:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` Mirror bool `json:"mirror"` LFS bool `json:"lfs"` LFSEndpoint string `json:"lfs_endpoint"` Private bool `json:"private"` Description string `json:"description" binding:"MaxSize(2048)"` Wiki bool `json:"wiki"` Milestones bool `json:"milestones"` Labels bool `json:"labels"` Issues bool `json:"issues"` PullRequests bool `json:"pull_requests"` Releases bool `json:"releases"` MirrorInterval string `json:"mirror_interval"` }
MigrateRepoForm form for migrating repository this is used to interact with web ui
type MustChangePasswordForm ¶
type MustChangePasswordForm struct { Password string `binding:"Required;MaxSize(255)"` Retype string }
MustChangePasswordForm form for updating your password after account creation by an admin
type NewAccessTokenForm ¶
NewAccessTokenForm form for creating access token
func (*NewAccessTokenForm) GetScope ¶ added in v1.19.0
func (f *NewAccessTokenForm) GetScope() (auth_model.AccessTokenScope, error)
type NewBranchForm ¶
type NewBranchForm struct { NewBranchName string `binding:"Required;MaxSize(100);GitRefName"` CurrentPath string CreateTag bool }
NewBranchForm form for creating a new branch
type NewDingtalkHookForm ¶
type NewDingtalkHookForm struct { PayloadURL string `binding:"Required;ValidUrl"` WebhookForm }
NewDingtalkHookForm form for creating dingtalk hook
type NewDiscordHookForm ¶
type NewDiscordHookForm struct { PayloadURL string `binding:"Required;ValidUrl"` Username string IconURL string WebhookForm }
NewDiscordHookForm form for creating discord hook
type NewFeishuHookForm ¶
type NewFeishuHookForm struct { PayloadURL string `binding:"Required;ValidUrl"` WebhookForm }
NewFeishuHookForm form for creating feishu hook
type NewGogshookForm ¶
type NewGogshookForm struct { PayloadURL string `binding:"Required;ValidUrl"` ContentType int `binding:"Required"` Secret string WebhookForm }
NewGogshookForm form for creating gogs hook
type NewMSTeamsHookForm ¶
type NewMSTeamsHookForm struct { PayloadURL string `binding:"Required;ValidUrl"` WebhookForm }
NewMSTeamsHookForm form for creating MS Teams hook
type NewMatrixHookForm ¶
type NewMatrixHookForm struct { HomeserverURL string `binding:"Required;ValidUrl"` RoomID string `binding:"Required"` MessageType int WebhookForm }
NewMatrixHookForm form for creating Matrix hook
type NewPackagistHookForm ¶ added in v1.17.0
type NewPackagistHookForm struct { Username string `binding:"Required"` APIToken string `binding:"Required"` PackageURL string `binding:"Required;ValidUrl"` WebhookForm }
NewPackagistHookForm form for creating packagist hook
type NewReleaseForm ¶
type NewReleaseForm struct { TagName string `binding:"Required;GitRefName;MaxSize(255)"` Target string `form:"tag_target" binding:"Required;MaxSize(255)"` Title string `binding:"MaxSize(255)"` Content string Draft string TagOnly string Prerelease bool AddTagMsg bool Files []string }
NewReleaseForm form for creating release
type NewSlackHookForm ¶
type NewSlackHookForm struct { PayloadURL string `binding:"Required;ValidUrl"` Channel string `binding:"Required"` Username string IconURL string Color string WebhookForm }
NewSlackHookForm form for creating slack hook
type NewTelegramHookForm ¶
type NewTelegramHookForm struct { BotToken string `binding:"Required"` ChatID string `binding:"Required"` WebhookForm }
NewTelegramHookForm form for creating telegram hook
type NewWebhookForm ¶
type NewWebhookForm struct { PayloadURL string `binding:"Required;ValidUrl"` HTTPMethod string `binding:"Required;In(POST,GET)"` ContentType int `binding:"Required"` Secret string WebhookForm }
NewWebhookForm form for creating web hook
type NewWechatWorkHookForm ¶ added in v1.16.0
type NewWechatWorkHookForm struct { PayloadURL string `binding:"Required;ValidUrl"` WebhookForm }
NewWechatWorkHookForm form for creating wechatwork hook
type NewWikiForm ¶
type NewWikiForm struct { Title string `binding:"Required"` Content string `binding:"Required"` Message string }
NewWikiForm form for creating wiki
type PackageCleanupRuleForm ¶ added in v1.17.4
type PackageCleanupRuleForm struct { ID int64 Enabled bool Type string `` /* 151-byte string literal not displayed */ KeepCount int `binding:"In(0,1,5,10,25,50,100)"` KeepPattern string `binding:"RegexPattern"` RemoveDays int `binding:"In(0,7,14,30,60,90,180)"` RemovePattern string `binding:"RegexPattern"` MatchFullName bool Action string `binding:"Required;In(save,remove)"` }
type PackageSettingForm ¶ added in v1.17.0
PackageSettingForm form for package settings
type ProtectBranchForm ¶
type ProtectBranchForm struct { RuleName string `binding:"Required"` RuleID int64 EnablePush string WhitelistUsers string WhitelistTeams string WhitelistDeployKeys bool EnableMergeWhitelist bool MergeWhitelistUsers string MergeWhitelistTeams string EnableStatusCheck bool StatusCheckContexts string RequiredApprovals int64 EnableApprovalsWhitelist bool ApprovalsWhitelistUsers string ApprovalsWhitelistTeams string BlockOnRejectedReviews bool BlockOnOfficialReviewRequests bool BlockOnOutdatedBranch bool DismissStaleApprovals bool RequireSignedCommits bool ProtectedFilePatterns string UnprotectedFilePatterns string }
ProtectBranchForm form for changing protected branch settings
type ProtectTagForm ¶
type ProtectTagForm struct { NamePattern string `binding:"Required;GlobOrRegexPattern"` AllowlistUsers string AllowlistTeams string }
ProtectTagForm form for changing protected tag settings
type ReactionForm ¶
type ReactionForm struct {
Content string `binding:"Required"`
}
ReactionForm form for adding and removing reaction
type RegisterForm ¶
type RegisterForm struct { UserName string `binding:"Required;Username;MaxSize(40)"` Email string `binding:"Required;MaxSize(254)"` Password string `binding:"MaxSize(255)"` Retype string }
RegisterForm form for registering
func (*RegisterForm) IsEmailDomainAllowed ¶
func (f *RegisterForm) IsEmailDomainAllowed() bool
IsEmailDomainAllowed validates that the email address provided by the user matches what has been configured . The email is marked as allowed if it matches any of the domains in the whitelist or if it doesn't match any of domains in the blocklist, if any such list is not empty.
type RemoveUploadFileForm ¶
type RemoveUploadFileForm struct {
File string `binding:"Required;MaxSize(50)"`
}
RemoveUploadFileForm form for removing uploaded file
type RenameBranchForm ¶ added in v1.16.0
type RenameBranchForm struct { From string `binding:"Required;MaxSize(100);GitRefName"` To string `binding:"Required;MaxSize(100);GitRefName"` }
RenameBranchForm form for rename a branch
type RepoSettingForm ¶
type RepoSettingForm struct { RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` Description string `binding:"MaxSize(2048)"` Website string `binding:"ValidUrl;MaxSize(1024)"` Interval string MirrorAddress string MirrorUsername string MirrorPassword string LFS bool `form:"mirror_lfs"` LFSEndpoint string `form:"mirror_lfs_endpoint"` PushMirrorID string PushMirrorAddress string PushMirrorUsername string PushMirrorPassword string PushMirrorSyncOnCommit bool PushMirrorInterval string Private bool Template bool EnablePrune bool // Advanced settings EnableCode bool EnableWiki bool EnableExternalWiki bool ExternalWikiURL string EnableIssues bool EnableExternalTracker bool ExternalTrackerURL string TrackerURLFormat string TrackerIssueStyle string ExternalTrackerRegexpPattern string EnableCloseIssuesViaCommitInAnyBranch bool EnableProjects bool EnableReleases bool EnablePackages bool EnablePulls bool EnableActions bool PullsIgnoreWhitespace bool PullsAllowMerge bool PullsAllowRebase bool PullsAllowRebaseMerge bool PullsAllowSquash bool PullsAllowManualMerge bool PullsDefaultMergeStyle string EnableAutodetectManualMerge bool PullsAllowRebaseUpdate bool DefaultDeleteBranchAfterMerge bool DefaultAllowMaintainerEdit bool EnableTimetracker bool AllowOnlyContributorsToTrackTime bool EnableIssueDependencies bool IsArchived bool // Signing Settings TrustModel string // Admin settings EnableHealthCheck bool RequestReindexType string }
RepoSettingForm form for changing repository settings
type SaveTopicForm ¶
type SaveTopicForm struct {
Topics []string `binding:"topics;Required;"`
}
SaveTopicForm form for save topics for repository
type SignInForm ¶
type SignInForm struct { UserName string `binding:"Required;MaxSize(254)"` // TODO remove required from password for SecondFactorAuthentication Password string `binding:"Required;MaxSize(255)"` Remember bool }
SignInForm form for signing in with user/password
type SignInOpenIDForm ¶
SignInOpenIDForm form for signing in with OpenID
type SignUpOpenIDForm ¶
type SignUpOpenIDForm struct { UserName string `binding:"Required;Username;MaxSize(40)"` Email string `binding:"Required;Email;MaxSize(254)"` }
SignUpOpenIDForm form for signin up with OpenID
type SubmitReviewForm ¶
SubmitReviewForm for submitting a finished code review
func (SubmitReviewForm) HasEmptyContent ¶
func (f SubmitReviewForm) HasEmptyContent() bool
HasEmptyContent checks if the content of the review form is empty.
func (SubmitReviewForm) ReviewType ¶
func (f SubmitReviewForm) ReviewType() issues_model.ReviewType
ReviewType will return the corresponding ReviewType for type
type TwoFactorAuthForm ¶
type TwoFactorAuthForm struct {
Passcode string `binding:"Required"`
}
TwoFactorAuthForm for logging in with 2FA token.
type TwoFactorScratchAuthForm ¶
type TwoFactorScratchAuthForm struct {
Token string `binding:"Required"`
}
TwoFactorScratchAuthForm for logging in with 2FA scratch token.
type UpdateAllowEditsForm ¶ added in v1.17.0
type UpdateAllowEditsForm struct {
AllowMaintainerEdit bool
}
UpdateAllowEditsForm form for changing if PR allows edits from maintainers
type UpdateLanguageForm ¶ added in v1.16.0
type UpdateLanguageForm struct {
Language string
}
UpdateLanguageForm form for updating profile
type UpdateOrgSettingForm ¶
type UpdateOrgSettingForm struct { Name string `binding:"Required;Username;MaxSize(40)" locale:"org.org_name_holder"` FullName string `binding:"MaxSize(100)"` Description string `binding:"MaxSize(255)"` Website string `binding:"ValidUrl;MaxSize(255)"` Location string `binding:"MaxSize(50)"` Visibility structs.VisibleType MaxRepoCreation int RepoAdminChangeTeamAccess bool }
UpdateOrgSettingForm form for updating organization settings
type UpdateProfileForm ¶
type UpdateProfileForm struct { Name string `binding:"Username;MaxSize(40)"` FullName string `binding:"MaxSize(100)"` KeepEmailPrivate bool Website string `binding:"ValidSiteUrl;MaxSize(255)"` Location string `binding:"MaxSize(50)"` Description string `binding:"MaxSize(255)"` Visibility structs.VisibleType KeepActivityPrivate bool }
UpdateProfileForm form for updating profile
type UpdateThemeForm ¶
type UpdateThemeForm struct {
Theme string `binding:"Required;MaxSize(30)"`
}
UpdateThemeForm form for updating a users' theme
func (UpdateThemeForm) IsThemeExists ¶
func (f UpdateThemeForm) IsThemeExists() bool
IsThemeExists checks if the theme is a theme available in the config.
type UploadRepoFileForm ¶
type UploadRepoFileForm struct { TreePath string `binding:"MaxSize(500)"` CommitSummary string `binding:"MaxSize(100)"` CommitMessage string CommitChoice string `binding:"Required;MaxSize(50)"` NewBranchName string `binding:"GitRefName;MaxSize(100)"` Files []string Signoff bool }
UploadRepoFileForm form for uploading repository file
type UserCreateProjectForm ¶
type UserCreateProjectForm struct { Title string `binding:"Required;MaxSize(100)"` Content string BoardType project_model.BoardType CardType project_model.CardType UID int64 `binding:"Required"` }
UserCreateProjectForm is a from for creating an individual or organization form.
type WebauthnDeleteForm ¶ added in v1.16.0
type WebauthnDeleteForm struct {
ID int64 `binding:"Required"`
}
WebauthnDeleteForm for deleting WebAuthn keys
type WebauthnRegistrationForm ¶ added in v1.16.0
type WebauthnRegistrationForm struct {
Name string `binding:"Required"`
}
WebauthnRegistrationForm for reserving an WebAuthn name
type WebhookForm ¶
type WebhookForm struct { Events string Create bool Delete bool Fork bool Issues bool IssueAssign bool IssueLabel bool IssueMilestone bool IssueComment bool Release bool Push bool PullRequest bool PullRequestAssign bool PullRequestLabel bool PullRequestMilestone bool PullRequestComment bool PullRequestReview bool PullRequestSync bool PullRequestReviewRequest bool Wiki bool Repository bool Package bool Active bool BranchFilter string `binding:"GlobPattern"` AuthorizationHeader string }
WebhookForm form for changing web hook
func (WebhookForm) ChooseEvents ¶
func (f WebhookForm) ChooseEvents() bool
ChooseEvents if the hook will be triggered choose events
func (WebhookForm) PushOnly ¶
func (f WebhookForm) PushOnly() bool
PushOnly if the hook will be triggered when push
func (WebhookForm) SendEverything ¶
func (f WebhookForm) SendEverything() bool
SendEverything if the hook will be triggered any event