mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-11 17:25:24 +01:00
33 lines
755 B
Go
33 lines
755 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package renderplugin
|
|
|
|
import (
|
|
"path"
|
|
|
|
"code.gitea.io/gitea/modules/storage"
|
|
)
|
|
|
|
// Storage returns the object storage used for render plugins.
|
|
func Storage() storage.ObjectStorage {
|
|
return storage.RenderPlugins
|
|
}
|
|
|
|
// ObjectPath builds a storage-relative path for a plugin asset.
|
|
func ObjectPath(identifier string, elems ...string) string {
|
|
joined := path.Join(elems...)
|
|
if joined == "." || joined == "" {
|
|
return path.Join(identifier)
|
|
}
|
|
return path.Join(identifier, joined)
|
|
}
|
|
|
|
// ObjectPrefix returns the storage prefix for a plugin identifier.
|
|
func ObjectPrefix(identifier string) string {
|
|
if identifier == "" {
|
|
return ""
|
|
}
|
|
return identifier + "/"
|
|
}
|