117 lines
4.9 KiB
Go
117 lines
4.9 KiB
Go
// Package enums ...
|
|
//
|
|
// Description : enums ...
|
|
//
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
//
|
|
// Date : 2025-08-23 09:40
|
|
package enums
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
type License string
|
|
|
|
func (l License) String() string {
|
|
return string(l)
|
|
}
|
|
|
|
// MarshalJSON 支持序列化
|
|
func (l License) MarshalJSON() ([]byte, error) {
|
|
return []byte(`"` + l.String() + `"`), nil
|
|
}
|
|
|
|
// UnmarshalJSON 支持反序列化
|
|
func (l *License) UnmarshalJSON(d []byte) error {
|
|
*l = License(strings.Trim(string(d), `"`))
|
|
return nil
|
|
}
|
|
|
|
const (
|
|
LicenseAfl30 License = "AFL-3.0"
|
|
LicenseAgpl30 License = "AGPL-3.0"
|
|
LicenseApache10 License = "Apache-1.0"
|
|
LicenseApache11 License = "Apache-1.1"
|
|
LicenseApache20 License = "Apache-2.0"
|
|
LicenseArtistic20 License = "Artistic-2.0"
|
|
LicenseBsd2Clause License = "BSD-2-Clause"
|
|
LicenseBsd3Clause License = "BSD-3-Clause"
|
|
LicenseBsd4Clause License = "BSD-4-Clause"
|
|
LicenseBsl10 License = "BSL-1.0"
|
|
LicenseCcBy40 License = "CC-BY-4.0"
|
|
LicenseCcBySa40 License = "CC-BY-SA-4.0"
|
|
LicenseCc010 License = "CC0-1.0"
|
|
LicenseEcl20 License = "ECL-2.0"
|
|
LicenseEpl10 License = "EPL-1.0"
|
|
LicenseEpl20 License = "EPL-2.0"
|
|
LicenseEupl11 License = "EUPL-1.1"
|
|
LicenseEupl12 License = "EUPL-1.2"
|
|
LicenseGpl20 License = "GPL-2.0"
|
|
LicenseGpl30 License = "GPL-3.0"
|
|
LicenseIsc License = "ISC"
|
|
LicenseLgpl21 License = "LGPL-2.1"
|
|
LicenseLgpl30 License = "LGPL-3.0"
|
|
LicenseLppl13c License = "LPPL-1.3c"
|
|
LicenseMit License = "MIT"
|
|
LicenseMpl20 License = "MPL-2.0"
|
|
LicenseMsPl License = "MS-PL"
|
|
LicenseMsRl License = "MS-RL"
|
|
LicenseMulanpsl10 License = "MulanPSL-1.0"
|
|
LicenseMulanpubl10 License = "MulanPubL-1.0"
|
|
LicenseMulanpubl20 License = "MulanPubL-2.0"
|
|
LicenseNcsa License = "NCSA"
|
|
LicenseOfl11 License = "OFL-1.1"
|
|
LicenseOsl30 License = "OSL-3.0"
|
|
LicensePostgresql License = "PostgreSQL"
|
|
LicenseUpl10 License = "UPL-1.0"
|
|
LicenseUnlicense License = "Unlicense"
|
|
LicenseWtfpl License = "WTFPL"
|
|
LicenseZlib License = "Zlib"
|
|
)
|
|
|
|
var (
|
|
// LicenseUrlTable 洗衣链接表
|
|
LicenseUrlTable = map[License]string{
|
|
LicenseAfl30: "https://spdx.org/licenses/AFL-3.0",
|
|
LicenseAgpl30: "https://www.gnu.org/licenses/agpl-3.0.txt",
|
|
LicenseApache10: "https://www.apache.org/licenses/LICENSE-1.0",
|
|
LicenseApache11: "https://www.apache.org/licenses/LICENSE-1.1",
|
|
LicenseApache20: "https://www.apache.org/licenses/LICENSE-2.0.txt",
|
|
LicenseArtistic20: "https://spdx.org/licenses/Artistic-2.0",
|
|
LicenseBsd2Clause: "https://opensource.org/license/BSD-2-Clause",
|
|
LicenseBsd3Clause: "https://opensource.org/license/BSD-3-Clause",
|
|
LicenseBsd4Clause: "https://directory.fsf.org/wiki/License:BSD-4-Clause",
|
|
LicenseBsl10: "https://www.boost.org/LICENSE_1_0.txt",
|
|
LicenseCcBy40: "https://creativecommons.org/licenses/by/4.0/legalcode.txt",
|
|
LicenseCcBySa40: "https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt",
|
|
LicenseCc010: "https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt",
|
|
LicenseEcl20: "https://opensource.org/license/ecl-2-0",
|
|
LicenseEpl10: "https://www.eclipse.org/org/documents/epl-1.0/EPL-1.0.txt",
|
|
LicenseEpl20: "https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt",
|
|
LicenseEupl11: "https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/eupl1.1.-licence-en_0.pdf",
|
|
LicenseEupl12: "https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/eupl_v1.2_en.pdf",
|
|
LicenseGpl20: "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC1",
|
|
LicenseGpl30: "https://www.gnu.org/licenses/gpl-3.0.html#license-text",
|
|
LicenseIsc: "https://spdx.org/licenses/ISC",
|
|
LicenseLgpl21: "https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html",
|
|
LicenseLgpl30: "https://www.gnu.org/licenses/lgpl-3.0-standalone.html",
|
|
LicenseLppl13c: "https://www.latex-project.org/lppl/lppl-1-3c.txt",
|
|
LicenseMit: "https://spdx.org/licenses/MIT",
|
|
LicenseMpl20: "https://www.mozilla.org/en-US/MPL/2.0/",
|
|
LicenseMsPl: "https://opensource.org/license/ms-pl-html",
|
|
LicenseMsRl: "https://opensource.org/license/ms-rl-html",
|
|
LicenseMulanpsl10: "http://license.coscl.org.cn/MulanPSL",
|
|
LicenseMulanpubl10: "http://license.coscl.org.cn/MulanPubL-1.0",
|
|
LicenseMulanpubl20: "http://license.coscl.org.cn/MulanPubL-2.0",
|
|
LicenseNcsa: "https://spdx.org/licenses/NCSA",
|
|
LicenseOfl11: "https://openfontlicense.org/documents/OFL.txt",
|
|
LicenseOsl30: "https://opensource.org/license/osl-3-0-php",
|
|
LicensePostgresql: "https://www.postgresql.org/about/licence/",
|
|
LicenseUpl10: "https://spdx.org/licenses/UPL-1.0",
|
|
LicenseUnlicense: "https://unlicense.org/",
|
|
LicenseWtfpl: "https://spdx.org/licenses/WTFPL",
|
|
LicenseZlib: "https://www.zlib.net/zlib_license.html",
|
|
}
|
|
)
|