mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 04:51:39 +02:00
Remove dependency on config package
This commit is contained in:
@@ -24,7 +24,8 @@ type FsArchiveConfig struct {
|
||||
}
|
||||
|
||||
type FsArchive struct {
|
||||
path string
|
||||
path string
|
||||
clusters []string
|
||||
}
|
||||
|
||||
// For a given job, return the path of the `data.json`/`meta.json` file.
|
||||
@@ -54,8 +55,17 @@ func (fsa *FsArchive) Init(rawConfig json.RawMessage) error {
|
||||
if err := json.Unmarshal(rawConfig, &config); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fsa.path = config.Path
|
||||
|
||||
entries, err := os.ReadDir(fsa.path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, de := range entries {
|
||||
fsa.clusters = append(fsa.clusters, de.Name())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -166,6 +176,10 @@ func (fsa *FsArchive) StoreMeta(jobMeta *schema.JobMeta) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (fsa *FsArchive) GetClusters() []string {
|
||||
return fsa.clusters
|
||||
}
|
||||
|
||||
func (fsa *FsArchive) Import(jobMeta *schema.JobMeta, jobData *schema.JobData) error {
|
||||
|
||||
job := schema.Job{
|
||||
|
Reference in New Issue
Block a user