mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
support periodically cleaning up expired tokens
This commit is contained in:
@@ -12,6 +12,16 @@ type DataStore struct {
|
||||
databases []*Database
|
||||
}
|
||||
|
||||
// Count returns total count of database instances
|
||||
func (s *DataStore) Count() int {
|
||||
return len(s.databases)
|
||||
}
|
||||
|
||||
// Get returns a database instance by index
|
||||
func (s *DataStore) Get(index int) *Database {
|
||||
return s.databases[index]
|
||||
}
|
||||
|
||||
// Choose returns a database instance by sharding key
|
||||
func (s *DataStore) Choose(key int64) *Database {
|
||||
return s.databases[0]
|
||||
|
||||
Reference in New Issue
Block a user