{"modulePath":"github.com/RedAFD/code-core","version":"v1.14.0-rc8","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package forms\n\n## Constants\n\n```go\nconst (\n\tAvatarLocal  string = \"local\"\n\tAvatarByMail string = \"bymail\"\n)\n```\nAvatar types\n\n## Functions\n\n```go\nfunc IsEmailDomainListed(list []string, email string) bool\n```\nIsEmailDomainListed checks whether the domain of an email address matches a list of domains\n\n```go\nfunc ParseRemoteAddr(remoteAddr, authUsername, authPassword string) (string, error)\n```\nParseRemoteAddr checks if given remote address is valid, and returns composed URL with needed username and password.\n\n## Types\n\n```go\ntype AccessTokenForm struct {\n\tGrantType    string `json:\"grant_type\"`\n\tClientID     string `json:\"client_id\"`\n\tClientSecret string `json:\"client_secret\"`\n\tRedirectURI  string `json:\"redirect_uri\"`\n\tCode         string `json:\"code\"`\n\tRefreshToken string `json:\"refresh_token\"`\n\n\t// PKCE support\n\tCodeVerifier string `json:\"code_verifier\"`\n}\n```\nAccessTokenForm for issuing access tokens from authorization codes or refresh tokens\n\n```go\nfunc (f *AccessTokenForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype AddEmailForm struct {\n\tEmail string `binding:\"Required;Email;MaxSize(254)\"`\n}\n```\nAddEmailForm form for adding new email\n\n```go\nfunc (f *AddEmailForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype AddKeyForm struct {\n\tType       string `binding:\"OmitEmpty\"`\n\tTitle      string `binding:\"Required;MaxSize(50)\"`\n\tContent    string `binding:\"Required\"`\n\tIsWritable bool\n}\n```\nAddKeyForm form for adding SSH/GPG key\n\n```go\nfunc (f *AddKeyForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype AddOpenIDForm struct {\n\tOpenid string `binding:\"Required;MaxSize(256)\"`\n}\n```\nAddOpenIDForm is for changing openid uri\n\n```go\nfunc (f *AddOpenIDForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype AddTimeManuallyForm struct {\n\tHours   int `binding:\"Range(0,1000)\"`\n\tMinutes int `binding:\"Range(0,1000)\"`\n}\n```\nAddTimeManuallyForm form that adds spent time manually.\n\n```go\nfunc (f *AddTimeManuallyForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype AdminCreateUserForm struct {\n\tLoginType          string `binding:\"Required\"`\n\tLoginName          string\n\tUserName           string `binding:\"Required;AlphaDashDot;MaxSize(40)\"`\n\tEmail              string `binding:\"Required;Email;MaxSize(254)\"`\n\tPassword           string `binding:\"MaxSize(255)\"`\n\tSendNotify         bool\n\tMustChangePassword bool\n}\n```\nAdminCreateUserForm form for admin to create user\n\n```go\nfunc (f *AdminCreateUserForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates form fields\n\n```go\ntype AdminDashboardForm struct {\n\tOp   string `binding:\"required\"`\n\tFrom string\n}\n```\nAdminDashboardForm form for admin dashboard operations\n\n```go\nfunc (f *AdminDashboardForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates form fields\n\n```go\ntype AdminEditUserForm struct {\n\tLoginType               string `binding:\"Required\"`\n\tUserName                string `binding:\"AlphaDashDot;MaxSize(40)\"`\n\tLoginName               string\n\tFullName                string `binding:\"MaxSize(100)\"`\n\tEmail                   string `binding:\"Required;Email;MaxSize(254)\"`\n\tPassword                string `binding:\"MaxSize(255)\"`\n\tWebsite                 string `binding:\"ValidUrl;MaxSize(255)\"`\n\tLocation                string `binding:\"MaxSize(50)\"`\n\tMaxRepoCreation         int\n\tActive                  bool\n\tAdmin                   bool\n\tRestricted              bool\n\tAllowGitHook            bool\n\tAllowImportLocal        bool\n\tAllowCreateOrganization bool\n\tProhibitLogin           bool\n\tReset2FA                bool `form:\"reset_2fa\"`\n}\n```\nAdminEditUserForm form for admin to create user\n\n```go\nfunc (f *AdminEditUserForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates form fields\n\n```go\ntype AuthenticationForm struct {\n\tID                            int64\n\tType                          int    `binding:\"Range(2,7)\"`\n\tName                          string `binding:\"Required;MaxSize(30)\"`\n\tHost                          string\n\tPort                          int\n\tBindDN                        string\n\tBindPassword                  string\n\tUserBase                      string\n\tUserDN                        string\n\tAttributeUsername             string\n\tAttributeName                 string\n\tAttributeSurname              string\n\tAttributeMail                 string\n\tAttributeSSHPublicKey         string\n\tAttributesInBind              bool\n\tUsePagedSearch                bool\n\tSearchPageSize                int\n\tFilter                        string\n\tAdminFilter                   string\n\tGroupsEnabled                 bool\n\tGroupDN                       string\n\tGroupFilter                   string\n\tGroupMemberUID                string\n\tUserUID                       string\n\tRestrictedFilter              string\n\tAllowDeactivateAll            bool\n\tIsActive                      bool\n\tIsSyncEnabled                 bool\n\tSMTPAuth                      string\n\tSMTPHost                      string\n\tSMTPPort                      int\n\tAllowedDomains                string\n\tSecurityProtocol              int `binding:\"Range(0,2)\"`\n\tTLS                           bool\n\tSkipVerify                    bool\n\tPAMServiceName                string\n\tOauth2Provider                string\n\tOauth2Key                     string\n\tOauth2Secret                  string\n\tOpenIDConnectAutoDiscoveryURL string\n\tOauth2UseCustomURL            bool\n\tOauth2TokenURL                string\n\tOauth2AuthURL                 string\n\tOauth2ProfileURL              string\n\tOauth2EmailURL                string\n\tOauth2IconURL                 string\n\tSSPIAutoCreateUsers           bool\n\tSSPIAutoActivateUsers         bool\n\tSSPIStripDomainNames          bool\n\tSSPISeparatorReplacement      string `binding:\"AlphaDashDot;MaxSize(5)\"`\n\tSSPIDefaultLanguage           string\n}\n```\nAuthenticationForm form for authentication\n\n```go\nfunc (f *AuthenticationForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates fields\n\n```go\ntype AuthorizationForm struct {\n\tResponseType string `binding:\"Required;In(code)\"`\n\tClientID     string `binding:\"Required\"`\n\tRedirectURI  string\n\tState        string\n\tScope        string\n\tNonce        string\n\n\t// PKCE support\n\tCodeChallengeMethod string // S256, plain\n\tCodeChallenge       string\n}\n```\nAuthorizationForm form for authorizing oauth2 clients\n\n```go\nfunc (f *AuthorizationForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype AvatarForm struct {\n\tSource      string\n\tAvatar      *multipart.FileHeader\n\tGravatar    string `binding:\"OmitEmpty;Email;MaxSize(254)\"`\n\tFederavatar bool\n}\n```\nAvatarForm form for changing avatar\n\n```go\nfunc (f *AvatarForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype ChangePasswordForm struct {\n\tOldPassword string `form:\"old_password\" binding:\"MaxSize(255)\"`\n\tPassword    string `form:\"password\" binding:\"Required;MaxSize(255)\"`\n\tRetype      string `form:\"retype\"`\n}\n```\nChangePasswordForm form for changing password\n\n```go\nfunc (f *ChangePasswordForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CodeCommentForm struct {\n\tOrigin         string `binding:\"Required;In(timeline,diff)\"`\n\tContent        string `binding:\"Required\"`\n\tSide           string `binding:\"Required;In(previous,proposed)\"`\n\tLine           int64\n\tTreePath       string `form:\"path\" binding:\"Required\"`\n\tIsReview       bool   `form:\"is_review\"`\n\tReply          int64  `form:\"reply\"`\n\tLatestCommitID string\n}\n```\nCodeCommentForm form for adding code comments for PRs\n\n```go\nfunc (f *CodeCommentForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype ConnectOpenIDForm struct {\n\tUserName string `binding:\"Required;MaxSize(254)\"`\n\tPassword string `binding:\"Required;MaxSize(255)\"`\n}\n```\nConnectOpenIDForm form for connecting an existing account to an OpenID URI\n\n```go\nfunc (f *ConnectOpenIDForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CreateCommentForm struct {\n\tContent string\n\tStatus  string `binding:\"OmitEmpty;In(reopen,close)\"`\n\tFiles   []string\n}\n```\nCreateCommentForm form for creating comment\n\n```go\nfunc (f *CreateCommentForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CreateIssueForm struct {\n\tTitle       string `binding:\"Required;MaxSize(255)\"`\n\tLabelIDs    string `form:\"label_ids\"`\n\tAssigneeIDs string `form:\"assignee_ids\"`\n\tRef         string `form:\"ref\"`\n\tMilestoneID int64\n\tProjectID   int64\n\tAssigneeID  int64\n\tContent     string\n\tFiles       []string\n}\n```\nCreateIssueForm form for creating issue\n\n```go\nfunc (f *CreateIssueForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CreateLabelForm struct {\n\tID          int64\n\tTitle       string `binding:\"Required;MaxSize(50)\" locale:\"repo.issues.label_title\"`\n\tDescription string `binding:\"MaxSize(200)\" locale:\"repo.issues.label_description\"`\n\tColor       string `binding:\"Required;Size(7)\" locale:\"repo.issues.label_color\"`\n}\n```\nCreateLabelForm form for creating label\n\n```go\nfunc (f *CreateLabelForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CreateMilestoneForm struct {\n\tTitle    string `binding:\"Required;MaxSize(50)\"`\n\tContent  string\n\tDeadline string\n}\n```\nCreateMilestoneForm form for creating milestone\n\n```go\nfunc (f *CreateMilestoneForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CreateOrgForm struct {\n\tOrgName                   string `binding:\"Required;AlphaDashDot;MaxSize(40)\" locale:\"org.org_name_holder\"`\n\tVisibility                structs.VisibleType\n\tRepoAdminChangeTeamAccess bool\n}\n```\nCreateOrgForm form for creating organization\n\n```go\nfunc (f *CreateOrgForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CreateProjectForm struct {\n\tTitle     string `binding:\"Required;MaxSize(100)\"`\n\tContent   string\n\tBoardType models.ProjectBoardType\n}\n```\nCreateProjectForm form for creating a project\n\n```go\ntype CreateRepoForm struct {\n\tUID           int64  `binding:\"Required\"`\n\tRepoName      string `binding:\"Required;AlphaDashDot;MaxSize(100)\"`\n\tPrivate       bool\n\tDescription   string `binding:\"MaxSize(255)\"`\n\tDefaultBranch string `binding:\"GitRefName;MaxSize(100)\"`\n\tAutoInit      bool\n\tGitignores    string\n\tIssueLabels   string\n\tLicense       string\n\tReadme        string\n\tTemplate      bool\n\n\tRepoTemplate int64\n\tGitContent   bool\n\tTopics       bool\n\tGitHooks     bool\n\tWebhooks     bool\n\tAvatar       bool\n\tLabels       bool\n\tTrustModel   string\n}\n```\nCreateRepoForm form for creating repository\n\n```go\nfunc (f *CreateRepoForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype CreateTeamForm struct {\n\tTeamName         string `binding:\"Required;AlphaDashDot;MaxSize(30)\"`\n\tDescription      string `binding:\"MaxSize(255)\"`\n\tPermission       string\n\tUnits            []models.UnitType\n\tRepoAccess       string\n\tCanCreateOrgRepo bool\n}\n```\nCreateTeamForm form for creating team\n\n```go\nfunc (f *CreateTeamForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype DeadlineForm struct {\n\tDateString string `form:\"date\" binding:\"Required;Size(10)\"`\n}\n```\nDeadlineForm hold the validation rules for deadlines\n\n```go\nfunc (f *DeadlineForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype DeleteRepoFileForm struct {\n\tCommitSummary string `binding:\"MaxSize(100)\"`\n\tCommitMessage string\n\tCommitChoice  string `binding:\"Required;MaxSize(50)\"`\n\tNewBranchName string `binding:\"GitRefName;MaxSize(100)\"`\n\tLastCommit    string\n\tSignoff       bool\n}\n```\nDeleteRepoFileForm form for deleting repository file\n\n```go\nfunc (f *DeleteRepoFileForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype DismissReviewForm struct {\n\tReviewID int64 `binding:\"Required\"`\n\tMessage  string\n}\n```\nDismissReviewForm for dismissing stale review by repo admin\n\n```go\ntype EditOAuth2ApplicationForm struct {\n\tName        string `binding:\"Required;MaxSize(255)\" form:\"application_name\"`\n\tRedirectURI string `binding:\"Required\" form:\"redirect_uri\"`\n}\n```\nEditOAuth2ApplicationForm form for editing oauth2 applications\n\n```go\nfunc (f *EditOAuth2ApplicationForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype EditPreviewDiffForm struct {\n\tContent string\n}\n```\nEditPreviewDiffForm form for changing preview diff\n\n```go\nfunc (f *EditPreviewDiffForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype EditProjectBoardForm struct {\n\tTitle   string `binding:\"Required;MaxSize(100)\"`\n\tSorting int8\n}\n```\nEditProjectBoardForm is a form for editing a project board\n\n```go\ntype EditReleaseForm struct {\n\tTitle      string `form:\"title\" binding:\"Required;MaxSize(255)\"`\n\tContent    string `form:\"content\"`\n\tDraft      string `form:\"draft\"`\n\tPrerelease bool   `form:\"prerelease\"`\n\tFiles      []string\n}\n```\nEditReleaseForm form for changing release\n\n```go\nfunc (f *EditReleaseForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype EditRepoFileForm struct {\n\tTreePath      string `binding:\"Required;MaxSize(500)\"`\n\tContent       string\n\tCommitSummary string `binding:\"MaxSize(100)\"`\n\tCommitMessage string\n\tCommitChoice  string `binding:\"Required;MaxSize(50)\"`\n\tNewBranchName string `binding:\"GitRefName;MaxSize(100)\"`\n\tLastCommit    string\n\tSignoff       bool\n}\n```\nEditRepoFileForm form for changing repository file\n\n```go\nfunc (f *EditRepoFileForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype GrantApplicationForm struct {\n\tClientID    string `binding:\"Required\"`\n\tRedirectURI string\n\tState       string\n\tScope       string\n\tNonce       string\n}\n```\nGrantApplicationForm form for authorizing oauth2 clients\n\n```go\nfunc (f *GrantApplicationForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype InitializeLabelsForm struct {\n\tTemplateName string `binding:\"Required\"`\n}\n```\nInitializeLabelsForm form for initializing labels\n\n```go\nfunc (f *InitializeLabelsForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype InstallForm struct {\n\tDbType   string `binding:\"Required\"`\n\tDbHost   string\n\tDbUser   string\n\tDbPasswd string\n\tDbName   string\n\tSSLMode  string\n\tCharset  string `binding:\"Required;In(utf8,utf8mb4)\"`\n\tDbPath   string\n\tDbSchema string\n\n\tAppName      string `binding:\"Required\" locale:\"install.app_name\"`\n\tRepoRootPath string `binding:\"Required\"`\n\tLFSRootPath  string\n\tRunUser      string `binding:\"Required\"`\n\tDomain       string `binding:\"Required\"`\n\tSSHPort      int\n\tHTTPPort     string `binding:\"Required\"`\n\tAppURL       string `binding:\"Required\"`\n\tLogRootPath  string `binding:\"Required\"`\n\n\tSMTPHost        string\n\tSMTPFrom        string\n\tSMTPUser        string `binding:\"OmitEmpty;MaxSize(254)\" locale:\"install.mailer_user\"`\n\tSMTPPasswd      string\n\tRegisterConfirm bool\n\tMailNotify      bool\n\n\tOfflineMode                    bool\n\tDisableGravatar                bool\n\tEnableFederatedAvatar          bool\n\tEnableOpenIDSignIn             bool\n\tEnableOpenIDSignUp             bool\n\tDisableRegistration            bool\n\tAllowOnlyExternalRegistration  bool\n\tEnableCaptcha                  bool\n\tRequireSignInView              bool\n\tDefaultKeepEmailPrivate        bool\n\tDefaultAllowCreateOrganization bool\n\tDefaultEnableTimetracking      bool\n\tNoReplyAddress                 string\n\n\tPasswordAlgorithm string\n\n\tAdminName          string `binding:\"OmitEmpty;AlphaDashDot;MaxSize(30)\" locale:\"install.admin_name\"`\n\tAdminPasswd        string `binding:\"OmitEmpty;MaxSize(255)\" locale:\"install.admin_password\"`\n\tAdminConfirmPasswd string\n\tAdminEmail         string `binding:\"OmitEmpty;MinSize(3);MaxSize(254);Include(@)\" locale:\"install.admin_email\"`\n}\n```\nInstallForm form for installation page\n\n```go\nfunc (f *InstallForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype IssueLockForm struct {\n\tReason string `binding:\"Required\"`\n}\n```\nIssueLockForm form for locking an issue\n\n```go\nfunc (i IssueLockForm) HasValidReason() bool\n```\nHasValidReason checks to make sure that the reason submitted in the form matches any of the values in the config\n\n```go\nfunc (i *IssueLockForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype MergePullRequestForm struct {\n\t// required: true\n\t// enum: merge,rebase,rebase-merge,squash,manually-merged\n\tDo                string `binding:\"Required;In(merge,rebase,rebase-merge,squash,manually-merged)\"`\n\tMergeTitleField   string\n\tMergeMessageField string\n\tMergeCommitID     string // only used for manually-merged\n\tForceMerge        *bool  `json:\"force_merge,omitempty\"`\n}\n```\nMergePullRequestForm form for merging Pull Request swagger:model MergePullRequestOption\n\n```go\nfunc (f *MergePullRequestForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype MigrateRepoForm struct {\n\t// required: true\n\tCloneAddr    string                 `json:\"clone_addr\" binding:\"Required\"`\n\tService      structs.GitServiceType `json:\"service\"`\n\tAuthUsername string                 `json:\"auth_username\"`\n\tAuthPassword string                 `json:\"auth_password\"`\n\tAuthToken    string                 `json:\"auth_token\"`\n\t// required: true\n\tUID int64 `json:\"uid\" binding:\"Required\"`\n\t// required: true\n\tRepoName       string `json:\"repo_name\" binding:\"Required;AlphaDashDot;MaxSize(100)\"`\n\tMirror         bool   `json:\"mirror\"`\n\tPrivate        bool   `json:\"private\"`\n\tDescription    string `json:\"description\" binding:\"MaxSize(255)\"`\n\tWiki           bool   `json:\"wiki\"`\n\tMilestones     bool   `json:\"milestones\"`\n\tLabels         bool   `json:\"labels\"`\n\tIssues         bool   `json:\"issues\"`\n\tPullRequests   bool   `json:\"pull_requests\"`\n\tReleases       bool   `json:\"releases\"`\n\tMirrorInterval string `json:\"mirror_interval\"`\n}\n```\nMigrateRepoForm form for migrating repository this is used to interact with web ui\n\n```go\nfunc (f *MigrateRepoForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype MustChangePasswordForm struct {\n\tPassword string `binding:\"Required;MaxSize(255)\"`\n\tRetype   string\n}\n```\nMustChangePasswordForm form for updating your password after account creation by an admin\n\n```go\nfunc (f *MustChangePasswordForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewAccessTokenForm struct {\n\tName string `binding:\"Required;MaxSize(255)\"`\n}\n```\nNewAccessTokenForm form for creating access token\n\n```go\nfunc (f *NewAccessTokenForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewBranchForm struct {\n\tNewBranchName string `binding:\"Required;MaxSize(100);GitRefName\"`\n\tCreateTag     bool\n}\n```\nNewBranchForm form for creating a new branch\n\n```go\nfunc (f *NewBranchForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewDingtalkHookForm struct {\n\tPayloadURL string `binding:\"Required;ValidUrl\"`\n\tWebhookForm\n}\n```\nNewDingtalkHookForm form for creating dingtalk hook\n\n```go\nfunc (f *NewDingtalkHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewDiscordHookForm struct {\n\tPayloadURL string `binding:\"Required;ValidUrl\"`\n\tUsername   string\n\tIconURL    string\n\tWebhookForm\n}\n```\nNewDiscordHookForm form for creating discord hook\n\n```go\nfunc (f *NewDiscordHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewFeishuHookForm struct {\n\tPayloadURL string `binding:\"Required;ValidUrl\"`\n\tWebhookForm\n}\n```\nNewFeishuHookForm form for creating feishu hook\n\n```go\nfunc (f *NewFeishuHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewGogshookForm struct {\n\tPayloadURL  string `binding:\"Required;ValidUrl\"`\n\tContentType int    `binding:\"Required\"`\n\tSecret      string\n\tWebhookForm\n}\n```\nNewGogshookForm form for creating gogs hook\n\n```go\nfunc (f *NewGogshookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewMSTeamsHookForm struct {\n\tPayloadURL string `binding:\"Required;ValidUrl\"`\n\tWebhookForm\n}\n```\nNewMSTeamsHookForm form for creating MS Teams hook\n\n```go\nfunc (f *NewMSTeamsHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewMatrixHookForm struct {\n\tHomeserverURL string `binding:\"Required;ValidUrl\"`\n\tRoomID        string `binding:\"Required\"`\n\tAccessToken   string `binding:\"Required\"`\n\tMessageType   int\n\tWebhookForm\n}\n```\nNewMatrixHookForm form for creating Matrix hook\n\n```go\nfunc (f *NewMatrixHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewReleaseForm struct {\n\tTagName    string `binding:\"Required;GitRefName;MaxSize(255)\"`\n\tTarget     string `form:\"tag_target\" binding:\"Required;MaxSize(255)\"`\n\tTitle      string `binding:\"Required;MaxSize(255)\"`\n\tContent    string\n\tDraft      string\n\tTagOnly    string\n\tPrerelease bool\n\tAddTagMsg  bool\n\tFiles      []string\n}\n```\nNewReleaseForm form for creating release\n\n```go\nfunc (f *NewReleaseForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewSlackHookForm struct {\n\tPayloadURL string `binding:\"Required;ValidUrl\"`\n\tChannel    string `binding:\"Required\"`\n\tUsername   string\n\tIconURL    string\n\tColor      string\n\tWebhookForm\n}\n```\nNewSlackHookForm form for creating slack hook\n\n```go\nfunc (f NewSlackHookForm) HasInvalidChannel() bool\n```\nHasInvalidChannel validates the channel name is in the right format\n\n```go\nfunc (f *NewSlackHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewTelegramHookForm struct {\n\tBotToken string `binding:\"Required\"`\n\tChatID   string `binding:\"Required\"`\n\tWebhookForm\n}\n```\nNewTelegramHookForm form for creating telegram hook\n\n```go\nfunc (f *NewTelegramHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewWebhookForm struct {\n\tPayloadURL  string `binding:\"Required;ValidUrl\"`\n\tHTTPMethod  string `binding:\"Required;In(POST,GET)\"`\n\tContentType int    `binding:\"Required\"`\n\tSecret      string\n\tWebhookForm\n}\n```\nNewWebhookForm form for creating web hook\n\n```go\nfunc (f *NewWebhookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype NewWikiForm struct {\n\tTitle   string `binding:\"Required\"`\n\tContent string `binding:\"Required\"`\n\tMessage string\n}\n```\nNewWikiForm form for creating wiki\n\n```go\nfunc (f *NewWikiForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields FIXME: use code generation to generate this method.\n\n```go\ntype ProtectBranchForm struct {\n\tProtected                     bool\n\tEnablePush                    string\n\tWhitelistUsers                string\n\tWhitelistTeams                string\n\tWhitelistDeployKeys           bool\n\tEnableMergeWhitelist          bool\n\tMergeWhitelistUsers           string\n\tMergeWhitelistTeams           string\n\tEnableStatusCheck             bool\n\tStatusCheckContexts           []string\n\tRequiredApprovals             int64\n\tEnableApprovalsWhitelist      bool\n\tApprovalsWhitelistUsers       string\n\tApprovalsWhitelistTeams       string\n\tBlockOnRejectedReviews        bool\n\tBlockOnOfficialReviewRequests bool\n\tBlockOnOutdatedBranch         bool\n\tDismissStaleApprovals         bool\n\tRequireSignedCommits          bool\n\tProtectedFilePatterns         string\n}\n```\nProtectBranchForm form for changing protected branch settings\n\n```go\nfunc (f *ProtectBranchForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype ReactionForm struct {\n\tContent string `binding:\"Required\"`\n}\n```\nReactionForm form for adding and removing reaction\n\n```go\nfunc (f *ReactionForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype RegisterForm struct {\n\tUserName           string `binding:\"Required;AlphaDashDot;MaxSize(40)\"`\n\tEmail              string `binding:\"Required;Email;MaxSize(254)\"`\n\tPassword           string `binding:\"MaxSize(255)\"`\n\tRetype             string\n\tGRecaptchaResponse string `form:\"g-recaptcha-response\"`\n\tHcaptchaResponse   string `form:\"h-captcha-response\"`\n}\n```\nRegisterForm form for registering\n\n```go\nfunc (f RegisterForm) IsEmailDomainAllowed() bool\n```\nIsEmailDomainAllowed 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.\n\n```go\nfunc (f *RegisterForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype RemoveUploadFileForm struct {\n\tFile string `binding:\"Required;MaxSize(50)\"`\n}\n```\nRemoveUploadFileForm form for removing uploaded file\n\n```go\nfunc (f *RemoveUploadFileForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype RepoSettingForm struct {\n\tRepoName       string `binding:\"Required;AlphaDashDot;MaxSize(100)\"`\n\tDescription    string `binding:\"MaxSize(255)\"`\n\tWebsite        string `binding:\"ValidUrl;MaxSize(255)\"`\n\tInterval       string\n\tMirrorAddress  string\n\tMirrorUsername string\n\tMirrorPassword string\n\tPrivate        bool\n\tTemplate       bool\n\tEnablePrune    bool\n\n\t// Advanced settings\n\tEnableWiki                            bool\n\tEnableExternalWiki                    bool\n\tExternalWikiURL                       string\n\tEnableIssues                          bool\n\tEnableExternalTracker                 bool\n\tExternalTrackerURL                    string\n\tTrackerURLFormat                      string\n\tTrackerIssueStyle                     string\n\tEnableCloseIssuesViaCommitInAnyBranch bool\n\tEnableProjects                        bool\n\tEnablePulls                           bool\n\tPullsIgnoreWhitespace                 bool\n\tPullsAllowMerge                       bool\n\tPullsAllowRebase                      bool\n\tPullsAllowRebaseMerge                 bool\n\tPullsAllowSquash                      bool\n\tPullsAllowManualMerge                 bool\n\tEnableAutodetectManualMerge           bool\n\tEnableTimetracker                     bool\n\tAllowOnlyContributorsToTrackTime      bool\n\tEnableIssueDependencies               bool\n\tIsArchived                            bool\n\n\t// Signing Settings\n\tTrustModel string\n\n\t// Admin settings\n\tEnableHealthCheck bool\n}\n```\nRepoSettingForm form for changing repository settings\n\n```go\nfunc (f *RepoSettingForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype SaveTopicForm struct {\n\tTopics []string `binding:\"topics;Required;\"`\n}\n```\nSaveTopicForm form for save topics for repository\n\n```go\ntype SignInForm struct {\n\tUserName string `binding:\"Required;MaxSize(254)\"`\n\t// TODO remove required from password for SecondFactorAuthentication\n\tPassword string `binding:\"Required;MaxSize(255)\"`\n\tRemember bool\n}\n```\nSignInForm form for signing in with user/password\n\n```go\nfunc (f *SignInForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype SignInOpenIDForm struct {\n\tOpenid   string `binding:\"Required;MaxSize(256)\"`\n\tRemember bool\n}\n```\nSignInOpenIDForm form for signing in with OpenID\n\n```go\nfunc (f *SignInOpenIDForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype SignUpOpenIDForm struct {\n\tUserName           string `binding:\"Required;AlphaDashDot;MaxSize(40)\"`\n\tEmail              string `binding:\"Required;Email;MaxSize(254)\"`\n\tGRecaptchaResponse string `form:\"g-recaptcha-response\"`\n\tHcaptchaResponse   string `form:\"h-captcha-response\"`\n}\n```\nSignUpOpenIDForm form for signin up with OpenID\n\n```go\nfunc (f *SignUpOpenIDForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype SubmitReviewForm struct {\n\tContent  string\n\tType     string `binding:\"Required;In(approve,comment,reject)\"`\n\tCommitID string\n}\n```\nSubmitReviewForm for submitting a finished code review\n\n```go\nfunc (f SubmitReviewForm) HasEmptyContent() bool\n```\nHasEmptyContent checks if the content of the review form is empty.\n\n```go\nfunc (f SubmitReviewForm) ReviewType() models.ReviewType\n```\nReviewType will return the corresponding reviewtype for type\n\n```go\nfunc (f *SubmitReviewForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype TwoFactorAuthForm struct {\n\tPasscode string `binding:\"Required\"`\n}\n```\nTwoFactorAuthForm for logging in with 2FA token.\n\n```go\nfunc (f *TwoFactorAuthForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype TwoFactorScratchAuthForm struct {\n\tToken string `binding:\"Required\"`\n}\n```\nTwoFactorScratchAuthForm for logging in with 2FA scratch token.\n\n```go\nfunc (f *TwoFactorScratchAuthForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype U2FDeleteForm struct {\n\tID int64 `binding:\"Required\"`\n}\n```\nU2FDeleteForm for deleting U2F keys\n\n```go\nfunc (f *U2FDeleteForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype U2FRegistrationForm struct {\n\tName string `binding:\"Required\"`\n}\n```\nU2FRegistrationForm for reserving an U2F name\n\n```go\nfunc (f *U2FRegistrationForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype UpdateOrgSettingForm struct {\n\tName                      string `binding:\"Required;AlphaDashDot;MaxSize(40)\" locale:\"org.org_name_holder\"`\n\tFullName                  string `binding:\"MaxSize(100)\"`\n\tDescription               string `binding:\"MaxSize(255)\"`\n\tWebsite                   string `binding:\"ValidUrl;MaxSize(255)\"`\n\tLocation                  string `binding:\"MaxSize(50)\"`\n\tVisibility                structs.VisibleType\n\tMaxRepoCreation           int\n\tRepoAdminChangeTeamAccess bool\n}\n```\nUpdateOrgSettingForm form for updating organization settings\n\n```go\nfunc (f *UpdateOrgSettingForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype UpdateProfileForm struct {\n\tName                string `binding:\"AlphaDashDot;MaxSize(40)\"`\n\tFullName            string `binding:\"MaxSize(100)\"`\n\tKeepEmailPrivate    bool\n\tWebsite             string `binding:\"ValidUrl;MaxSize(255)\"`\n\tLocation            string `binding:\"MaxSize(50)\"`\n\tLanguage            string\n\tDescription         string `binding:\"MaxSize(255)\"`\n\tKeepActivityPrivate bool\n}\n```\nUpdateProfileForm form for updating profile\n\n```go\nfunc (f *UpdateProfileForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype UpdateThemeForm struct {\n\tTheme string `binding:\"Required;MaxSize(30)\"`\n}\n```\nUpdateThemeForm form for updating a users' theme\n\n```go\nfunc (f UpdateThemeForm) IsThemeExists() bool\n```\nIsThemeExists checks if the theme is a theme available in the config.\n\n```go\nfunc (f *UpdateThemeForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the field\n\n```go\ntype UploadRepoFileForm struct {\n\tTreePath      string `binding:\"MaxSize(500)\"`\n\tCommitSummary string `binding:\"MaxSize(100)\"`\n\tCommitMessage string\n\tCommitChoice  string `binding:\"Required;MaxSize(50)\"`\n\tNewBranchName string `binding:\"GitRefName;MaxSize(100)\"`\n\tFiles         []string\n\tSignoff       bool\n}\n```\nUploadRepoFileForm form for uploading repository file\n\n```go\nfunc (f *UploadRepoFileForm) Validate(req *http.Request, errs binding.Errors) binding.Errors\n```\nValidate validates the fields\n\n```go\ntype UserCreateProjectForm struct {\n\tTitle     string `binding:\"Required;MaxSize(100)\"`\n\tContent   string\n\tBoardType models.ProjectBoardType\n\tUID       int64 `binding:\"Required\"`\n}\n```\nUserCreateProjectForm is a from for creating an individual or organization form.\n\n```go\ntype WebhookForm struct {\n\tEvents               string\n\tCreate               bool\n\tDelete               bool\n\tFork                 bool\n\tIssues               bool\n\tIssueAssign          bool\n\tIssueLabel           bool\n\tIssueMilestone       bool\n\tIssueComment         bool\n\tRelease              bool\n\tPush                 bool\n\tPullRequest          bool\n\tPullRequestAssign    bool\n\tPullRequestLabel     bool\n\tPullRequestMilestone bool\n\tPullRequestComment   bool\n\tPullRequestReview    bool\n\tPullRequestSync      bool\n\tRepository           bool\n\tActive               bool\n\tBranchFilter         string `binding:\"GlobPattern\"`\n}\n```\nWebhookForm form for changing web hook\n\n```go\nfunc (f WebhookForm) ChooseEvents() bool\n```\nChooseEvents if the hook will be triggered choose events\n\n```go\nfunc (f WebhookForm) PushOnly() bool\n```\nPushOnly if the hook will be triggered when push\n\n```go\nfunc (f WebhookForm) SendEverything() bool\n```\nSendEverything if the hook will be triggered any event\n\n","path":"github.com/RedAFD/code-core/modules/forms","name":"forms","synopsis":"","isRedistributable":true}
