diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-09-06 20:08:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-06 12:08:51 +0000 |
commit | b9df9fa2e22d0bbf66a549183749b9dfaca6bd2f (patch) | |
tree | 2746f647c6d5f616afa5fc9acd2103e7091cb1ff /modules/repository/license.go | |
parent | b3d88ada01c5bafe0581dc129fabe35a6faa3a85 (diff) | |
download | gitea-b9df9fa2e22d0bbf66a549183749b9dfaca6bd2f.tar.gz gitea-b9df9fa2e22d0bbf66a549183749b9dfaca6bd2f.zip |
Move createrepository from module to service layer (#26927)
Repository creation depends on many models, so moving it to service
layer is better.
Diffstat (limited to 'modules/repository/license.go')
-rw-r--r-- | modules/repository/license.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/repository/license.go b/modules/repository/license.go index 5b188a041e..6ac3547e7b 100644 --- a/modules/repository/license.go +++ b/modules/repository/license.go @@ -13,14 +13,14 @@ import ( "code.gitea.io/gitea/modules/options" ) -type licenseValues struct { +type LicenseValues struct { Owner string Email string Repo string Year string } -func getLicense(name string, values *licenseValues) ([]byte, error) { +func GetLicense(name string, values *LicenseValues) ([]byte, error) { data, err := options.License(name) if err != nil { return nil, fmt.Errorf("GetRepoInitFile[%s]: %w", name, err) @@ -28,7 +28,7 @@ func getLicense(name string, values *licenseValues) ([]byte, error) { return fillLicensePlaceholder(name, values, data), nil } -func fillLicensePlaceholder(name string, values *licenseValues, origin []byte) []byte { +func fillLicensePlaceholder(name string, values *LicenseValues, origin []byte) []byte { placeholder := getLicensePlaceholder(name) scanner := bufio.NewScanner(bytes.NewReader(origin)) |