34 lines
597 B
Go
34 lines
597 B
Go
package store
|
|
|
|
import (
|
|
"github.com/mehdioa/nlog"
|
|
"sync"
|
|
"time"
|
|
)
|
|
|
|
type Store struct {
|
|
TargetPath []string
|
|
SourcePath []string
|
|
GracePeriod time.Duration
|
|
Projects map[string]*Project
|
|
Logger *nlog.Logger
|
|
lock sync.RWMutex
|
|
}
|
|
|
|
type Project struct {
|
|
TargetPath string
|
|
LastChange time.Time
|
|
Created time.Time
|
|
ProjectName string
|
|
Logger *nlog.Node
|
|
}
|
|
|
|
func NewStore(Logger *nlog.Logger) *Store {
|
|
store := &Store{Logger: Logger, Projects: make(map[string]*Project)}
|
|
|
|
return store
|
|
}
|
|
|
|
func (store *Store) GetProjects() map[string]*Project {
|
|
return store.Projects
|
|
}
|