mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-04-21 12:38:05 +08:00
19 lines
257 B
Go
19 lines
257 B
Go
package services
|
|
|
|
import "sync"
|
|
|
|
type storageService struct {
|
|
}
|
|
|
|
var storage *storageService
|
|
var onceStorage sync.Once
|
|
|
|
func Storage() *storageService {
|
|
if storage == nil {
|
|
onceStorage.Do(func() {
|
|
storage = &storageService{}
|
|
})
|
|
}
|
|
return storage
|
|
}
|