mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 23:56:37 +08:00
docs: add package and exported symbol comments for revive lint compliance
This commit is contained in:
@@ -14,14 +14,17 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package storage 提供文件存储抽象层,包括 S3 兼容存储和本地缓存。
|
||||
package storage
|
||||
|
||||
// ErrS3InitializationFailed S3 存储初始化失败错误
|
||||
type ErrS3InitializationFailed struct{}
|
||||
|
||||
func (e ErrS3InitializationFailed) Error() string {
|
||||
return errS3InitializationFailed
|
||||
}
|
||||
|
||||
// LocalCacheError 本地缓存错误
|
||||
type LocalCacheError struct{}
|
||||
|
||||
func (e LocalCacheError) Error() string {
|
||||
|
||||
@@ -75,10 +75,12 @@ func init() {
|
||||
log.Printf("[Storage] S3 storage initialized (bucket: %s, prefix: %s, cdn: %s)\n", bucket, keyPrefix, cdnURL)
|
||||
}
|
||||
|
||||
// IsEnabledFunc 检查 S3 存储是否已初始化(可替换用于测试)
|
||||
var IsEnabledFunc = func() bool {
|
||||
return client != nil
|
||||
}
|
||||
|
||||
// IsEnabled 检查 S3 存储是否可用
|
||||
func IsEnabled() bool {
|
||||
return IsEnabledFunc()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user