Documentation
¶
Index ¶
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) GetUserStorage(_ context.Context, user string) map[string]string
- func (s *Storage) Ping(_ context.Context) error
- func (s *Storage) Restore(_ context.Context, id string) (link string, err error)
- func (s *Storage) Store(ctx context.Context, user string, link string) (id string, err error)
- func (s *Storage) StoreBatch(ctx context.Context, user string, batchIn map[string]string) (batchOut map[string]string, err error)
- func (s *Storage) Unstore(_ context.Context, _ string, _ []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage реализует хранение ссылок в памяти. Является потоко безопасной реализацией Repository
func (*Storage) GetUserStorage ¶
GetUserStorage возвращает map[id]link ранее сокращенных ссылок указанным пользователем
func (*Storage) Ping ¶
Ping проверяет, что экземпляр Storage создан корректно, например с помощью NewStorage()
Click to show internal directories.
Click to hide internal directories.