feat: init repo
This commit is contained in:
38
backend/providers/storage/config.go
Normal file
38
backend/providers/storage/config.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"git.ipao.vip/rogeecn/atom/container"
|
||||
"git.ipao.vip/rogeecn/atom/utils/opt"
|
||||
)
|
||||
|
||||
const DefaultPrefix = "Storage"
|
||||
|
||||
func DefaultProvider() container.ProviderContainer {
|
||||
return container.ProviderContainer{
|
||||
Provider: Provide,
|
||||
Options: []opt.Option{
|
||||
opt.Prefix(DefaultPrefix),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Path string
|
||||
Asset string
|
||||
|
||||
tmpStore map[string]string
|
||||
}
|
||||
|
||||
func (c *Config) AddTmpStore(key, value string) {
|
||||
c.tmpStore[key] = value
|
||||
}
|
||||
|
||||
func (c *Config) GetTmpStore(key string) string {
|
||||
return c.tmpStore[key]
|
||||
}
|
||||
|
||||
// HasTmpStore check if key exists in tmpStore
|
||||
func (c *Config) HasTmpStore(key string) bool {
|
||||
_, ok := c.tmpStore[key]
|
||||
return ok
|
||||
}
|
||||
Reference in New Issue
Block a user