mirror of
https://github.com/kemko/memes-telegram-integration.git
synced 2026-01-01 15:55:41 +03:00
30 lines
443 B
Go
30 lines
443 B
Go
package store
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
type Store struct {
|
|
Data string
|
|
|
|
userAccessTokenCache sync.Map // map[int64]string
|
|
}
|
|
|
|
func NewStore(data string) *Store {
|
|
return &Store{
|
|
Data: data,
|
|
|
|
userAccessTokenCache: sync.Map{},
|
|
}
|
|
}
|
|
|
|
func (s *Store) Init() error {
|
|
if err := s.loadUserAccessTokenMapFromFile(); err != nil {
|
|
return errors.Wrap(err, "failed to load user access token map from file")
|
|
}
|
|
|
|
return nil
|
|
}
|