add:partial functionality
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package services
|
||||
|
||||
import "fmt"
|
||||
|
||||
type ServicesStore struct {
|
||||
Config *ConfigService
|
||||
}
|
||||
@@ -11,3 +13,11 @@ func NewServicesStore() (*ServicesStore, error) {
|
||||
}
|
||||
return &ServicesStore{Config: cfg}, nil
|
||||
}
|
||||
|
||||
func (s *ServicesStore) NewStorageService(serverName string) (*StorageService, error) {
|
||||
srv, ok := s.Config.servers[serverName]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("server %q not found", serverName)
|
||||
}
|
||||
return NewStorageService(srv), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user