docs: add package and exported symbol comments for revive lint compliance

This commit is contained in:
ryan
2026-06-09 13:42:06 +08:00
parent 4ac9857fe8
commit b05d26c9c6
40 changed files with 87 additions and 0 deletions
+3
View File
@@ -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 {
+2
View File
@@ -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()
}