setting

package
v3.1.21 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 65 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LicenseTypes = []LicenseCategory{
	{
		Category: "Permissive Licenses",
		Licenses: []LicenseInfo{
			{"MIT", "MIT License", "Most popular overall, minimal restrictions"},
			{"Apache-2.0", "Apache License 2.0", "Like MIT, plus explicit patent protection"},
			{"BSD-2-Clause", "BSD 2-Clause", "Similar to MIT"},
			{"BSD-3-Clause", "BSD 3-Clause", "BSD with no-endorsement rule"},
		},
	},
	{
		Category: "Weak Copyleft Licenses",
		Licenses: []LicenseInfo{
			{"MPL-2.0", "Mozilla Public License 2.0", "Only modified files must remain open source"},
			{"LGPL-2.1", "LGPL 2.1", "Allows linking from proprietary software"},
			{"LGPL-3.0", "LGPL 3.0", "Allows linking from proprietary software"},
		},
	},
	{
		Category: "Strong Copyleft Licenses",
		Licenses: []LicenseInfo{
			{"GPL-2.0", "GNU GPL v2", "Derivatives must also be GPL"},
			{"GPL-3.0", "GNU GPL v3", "Derivatives must be GPL, includes patent clauses"},
		},
	},
	{
		Category: "Network/SaaS Copyleft",
		Licenses: []LicenseInfo{
			{"AGPL-3.0", "AGPL v3", "Like GPL, but closes the SaaS loophole"},
		},
	},
	{
		Category: "Source-Available",
		Licenses: []LicenseInfo{
			{"BSL-1.1", "Business Source License 1.1", "Commercial use restricted until change date"},
			{"BSL-1.0", "Boost Software License", "Permissive, similar to MIT"},
			{"SSPL-1.0", "Server Side Public License", "Requires publishing entire service stack"},
		},
	},
	{
		Category: "Public Domain",
		Licenses: []LicenseInfo{
			{"Unlicense", "Unlicense", "Public domain, no attribution required"},
			{"CC0-1.0", "CC0", "Public domain, internationally defensible"},
		},
	},
}

LicenseTypes defines all available license types

Functions

func ActionsGeneralSettings

func ActionsGeneralSettings(ctx *context.Context)

func ActionsUnitPost

func ActionsUnitPost(ctx *context.Context)

func AddCollaborativeOwner

func AddCollaborativeOwner(ctx *context.Context)

func AddTeamPost

func AddTeamPost(ctx *context.Context)

AddTeamPost response for adding a team to a repository

func ChangeCollaborationAccessMode

func ChangeCollaborationAccessMode(ctx *context.Context)

ChangeCollaborationAccessMode response for changing access of a collaboration

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 DeleteCollaboration

func DeleteCollaboration(ctx *context.Context)

DeleteCollaboration delete a collaboration for a repository

func DeleteCollaborativeOwner

func DeleteCollaborativeOwner(ctx *context.Context)

func DeleteDeployKey

func DeleteDeployKey(ctx *context.Context)

DeleteDeployKey response for deleting a deploy key

func DeleteProtectedBranchRulePost

func DeleteProtectedBranchRulePost(ctx *context.Context)

DeleteProtectedBranchRulePost delete protected branch rule by id

func DeleteProtectedTagPost

func DeleteProtectedTagPost(ctx *context.Context)

DeleteProtectedTagPost handles deletion of a protected tag

func DeleteTeam

func DeleteTeam(ctx *context.Context)

DeleteTeam response for deleting a team from a repository

func DeleteWebhook

func DeleteWebhook(ctx *context.Context)

DeleteWebhook delete a webhook

func DeployKeys

func DeployKeys(ctx *context.Context)

DeployKeys render the deploy keys list of a repository page

func DeployKeysPost

func DeployKeysPost(ctx *context.Context)

DeployKeysPost response for adding a deploy key of a repository

func DingtalkHooksEditPost

func DingtalkHooksEditPost(ctx *context.Context)

DingtalkHooksEditPost response for editing Dingtalk webhook

func DingtalkHooksNewPost

func DingtalkHooksNewPost(ctx *context.Context)

DingtalkHooksNewPost response for creating Dingtalk webhook

func DiscordHooksEditPost

func DiscordHooksEditPost(ctx *context.Context)

DiscordHooksEditPost response for editing Discord webhook

func DiscordHooksNewPost

func DiscordHooksNewPost(ctx *context.Context)

DiscordHooksNewPost response for creating Discord webhook

func EditProtectedTag

func EditProtectedTag(ctx *context.Context)

EditProtectedTag render the page to edit a protect tag

func EditProtectedTagPost

func EditProtectedTagPost(ctx *context.Context)

EditProtectedTagPost handles creation of a protect tag

func FeishuHooksEditPost

func FeishuHooksEditPost(ctx *context.Context)

FeishuHooksEditPost response for editing Feishu webhook

func FeishuHooksNewPost

func FeishuHooksNewPost(ctx *context.Context)

FeishuHooksNewPost response for creating Feishu webhook

func Gallery(ctx *context.Context)

Gallery shows the gallery settings page

func GalleryCaption added in v3.1.3

func GalleryCaption(ctx *context.Context)

GalleryCaption handles updating image caption

func GalleryDelete added in v3.1.3

func GalleryDelete(ctx *context.Context)

GalleryDelete handles image deletion

func GalleryUpload added in v3.1.3

func GalleryUpload(ctx *context.Context)

GalleryUpload handles image upload to .gallery folder

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 GiteaHooksEditPost

func GiteaHooksEditPost(ctx *context.Context)

GiteaHooksEditPost response for editing Gitea webhook

func GiteaHooksNewPost

func GiteaHooksNewPost(ctx *context.Context)

GiteaHooksNewPost response for creating Gitea webhook

func GogsHooksEditPost

func GogsHooksEditPost(ctx *context.Context)

GogsHooksEditPost response for editing Gogs webhook

func GogsHooksNewPost

func GogsHooksNewPost(ctx *context.Context)

GogsHooksNewPost response for creating Gogs webhook

func LFSAutoAssociate

func LFSAutoAssociate(ctx *context.Context)

LFSAutoAssociate auto associates accessible lfs files

func LFSDelete

func LFSDelete(ctx *context.Context)

LFSDelete disassociates the provided oid from the repository and if the lfs file is no longer associated with any repositories - deletes it

func LFSFileFind

func LFSFileFind(ctx *context.Context)

LFSFileFind guesses a sha for the provided oid (or uses the provided sha) and then finds the commits that contain this sha

func LFSFileGet

func LFSFileGet(ctx *context.Context)

LFSFileGet serves a single LFS file

func LFSFiles

func LFSFiles(ctx *context.Context)

LFSFiles shows a repository's LFS files

func LFSLockFile

func LFSLockFile(ctx *context.Context)

LFSLockFile locks a file

func LFSLocks

func LFSLocks(ctx *context.Context)

LFSLocks shows a repository's LFS locks

func LFSPointerFiles

func LFSPointerFiles(ctx *context.Context)

LFSPointerFiles will search the repository for pointer files and report which are missing LFS files in the content store

func LFSUnlock

func LFSUnlock(ctx *context.Context)

LFSUnlock forcibly unlocks an LFS lock

func License

func License(ctx *context.Context)

License shows the license settings page

func LicenseCreate added in v3.1.3

func LicenseCreate(ctx *context.Context)

LicenseCreate handles creating a new LICENSE.md file

func LicensePost

func LicensePost(ctx *context.Context)

LicensePost handles license link/save (updates database only, does not create file)

func LicenseScan

func LicenseScan(ctx *context.Context)

LicenseScan detects existing license files in the repository

func MSTeamsHooksEditPost

func MSTeamsHooksEditPost(ctx *context.Context)

MSTeamsHooksEditPost response for editing MSTeams webhook

func MSTeamsHooksNewPost

func MSTeamsHooksNewPost(ctx *context.Context)

MSTeamsHooksNewPost response for creating MSTeams webhook

func MatrixHooksEditPost

func MatrixHooksEditPost(ctx *context.Context)

MatrixHooksEditPost response for editing Matrix webhook

func MatrixHooksNewPost

func MatrixHooksNewPost(ctx *context.Context)

MatrixHooksNewPost response for creating Matrix webhook

func NewProtectedTagPost

func NewProtectedTagPost(ctx *context.Context)

NewProtectedTagPost handles creation of a protect tag

func PackagistHooksEditPost

func PackagistHooksEditPost(ctx *context.Context)

PackagistHooksEditPost response for editing Packagist webhook

func PackagistHooksNewPost

func PackagistHooksNewPost(ctx *context.Context)

PackagistHooksNewPost response for creating Packagist webhook

func Pages

func Pages(ctx *context.Context)

Pages shows the repository pages settings (General page)

func PagesBrand

func PagesBrand(ctx *context.Context)

func PagesBrandPost

func PagesBrandPost(ctx *context.Context)

func PagesContent

func PagesContent(ctx *context.Context)

func PagesContentPost

func PagesContentPost(ctx *context.Context)

func PagesFooter

func PagesFooter(ctx *context.Context)

func PagesFooterPost

func PagesFooterPost(ctx *context.Context)

func PagesHero

func PagesHero(ctx *context.Context)

func PagesHeroPost

func PagesHeroPost(ctx *context.Context)

func PagesPost

func PagesPost(ctx *context.Context)

func PagesPricing

func PagesPricing(ctx *context.Context)

func PagesPricingPost

func PagesPricingPost(ctx *context.Context)

func PagesSocial

func PagesSocial(ctx *context.Context)

func PagesSocialPost

func PagesSocialPost(ctx *context.Context)

func PagesTheme

func PagesTheme(ctx *context.Context)

func PagesThemePost

func PagesThemePost(ctx *context.Context)

func ParseHookEvent

func ParseHookEvent(form forms.WebhookForm) *webhook_module.HookEvent

ParseHookEvent convert web form content to webhook.HookEvent

func ProtectedBranchRules

func ProtectedBranchRules(ctx *context.Context)

ProtectedBranchRules render the page to protect the repository

func ProtectedTags

func ProtectedTags(ctx *context.Context)

Tags render the page to protect tags

func PublicAccess

func PublicAccess(ctx *context.Context)

func PublicAccessPost

func PublicAccessPost(ctx *context.Context)

func RenameBranchPost

func RenameBranchPost(ctx *context.Context)

RenameBranchPost responses for rename a branch

func ReplayWebhook

func ReplayWebhook(ctx *context.Context)

ReplayWebhook replays a webhook

func Secrets

func Secrets(ctx *context.Context)

func SecretsDelete

func SecretsDelete(ctx *context.Context)

func SecretsPost

func SecretsPost(ctx *context.Context)

func SetDefaultBranchPost

func SetDefaultBranchPost(ctx *context.Context)

SetDefaultBranchPost set default branch

func Settings

func Settings(ctx *context.Context)

Settings show a repository's settings page

func SettingsAvatar

func SettingsAvatar(ctx *context.Context)

SettingsAvatar save new POSTed repository avatar

func SettingsCtxData

func SettingsCtxData(ctx *context.Context)

SettingsCtxData is a middleware that sets all the general context data for the settings template.

func SettingsDeleteAvatar

func SettingsDeleteAvatar(ctx *context.Context)

SettingsDeleteAvatar delete repository avatar

func SettingsPost

func SettingsPost(ctx *context.Context)

SettingsPost response for changes of a repository

func SettingsProtectedBranch

func SettingsProtectedBranch(c *context.Context)

SettingsProtectedBranch renders the protected branch setting page

func SettingsProtectedBranchPost

func SettingsProtectedBranchPost(ctx *context.Context)

SettingsProtectedBranchPost updates the protected branch settings

func SlackHooksEditPost

func SlackHooksEditPost(ctx *context.Context)

SlackHooksEditPost response for editing Slack webhook

func SlackHooksNewPost

func SlackHooksNewPost(ctx *context.Context)

SlackHooksNewPost response for creating Slack webhook

func TelegramHooksEditPost

func TelegramHooksEditPost(ctx *context.Context)

TelegramHooksEditPost response for editing Telegram webhook

func TelegramHooksNewPost

func TelegramHooksNewPost(ctx *context.Context)

TelegramHooksNewPost response for creating Telegram webhook

func TestWebhook

func TestWebhook(ctx *context.Context)

TestWebhook test if web hook is work fine

func UpdateAvatarSetting

func UpdateAvatarSetting(ctx *context.Context, form forms.AvatarForm) error

UpdateAvatarSetting update repo's avatar

func UpdateBranchProtectionPriories

func UpdateBranchProtectionPriories(ctx *context.Context)

func WebHooksEdit

func WebHooksEdit(ctx *context.Context)

WebHooksEdit render editing web hook page

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 WechatworkHooksEditPost

func WechatworkHooksEditPost(ctx *context.Context)

WechatworkHooksEditPost response for editing Wechatwork webhook

func WechatworkHooksNewPost

func WechatworkHooksNewPost(ctx *context.Context)

WechatworkHooksNewPost response for creating Wechatwork webhook

Types

type GalleryImage added in v3.1.3

type GalleryImage struct {
	Name    string `json:"name"`
	Caption string `json:"caption"`
}

GalleryImage represents an image in the .gallery folder

type GalleryMetadata added in v3.1.3

type GalleryMetadata struct {
	Images []GalleryImage `json:"images"`
}

GalleryMetadata stored in .gallery/gallery.json

type LicenseCategory

type LicenseCategory struct {
	Category string
	Licenses []LicenseInfo
}

LicenseCategory holds a category of licenses

type LicenseInfo

type LicenseInfo struct {
	Key         string
	Name        string
	Description string
}

LicenseInfo holds license information

Source Files

  • actions.go
  • avatar.go
  • collaboration.go
  • default_branch.go
  • deploy_key.go
  • gallery.go
  • git_hooks.go
  • lfs.go
  • license.go
  • pages.go
  • protected_branch.go
  • protected_tag.go
  • public_access.go
  • secrets.go
  • setting.go
  • webhook.go

Jump to

Keyboard shortcuts

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