You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
memos/store/store.go

30 lines
703 B
Go

3 years ago
package store
import (
"sync"
"github.com/usememos/memos/server/profile"
)
// Store provides database access to all raw objects.
3 years ago
type Store struct {
Profile *profile.Profile
driver Driver
workspaceSettingCache sync.Map // map[string]*storepb.WorkspaceSetting
userCache sync.Map // map[int]*User
userSettingCache sync.Map // map[string]*storepb.UserSetting
idpCache sync.Map // map[int]*storepb.IdentityProvider
3 years ago
}
// New creates a new instance of Store.
func New(driver Driver, profile *profile.Profile) *Store {
3 years ago
return &Store{
driver: driver,
Profile: profile,
3 years ago
}
}
func (s *Store) Close() error {
return s.driver.Close()
}