Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Letters = "0123456789abcdefghijklmnopqrstuvwxyz"
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func NewCollection ¶
func NewCollection(storage StorageInterface) *Collection
func (*Collection) GenerateKey ¶
func (c *Collection) GenerateKey(URL string) (string, error)
func (*Collection) GenerateKeys ¶
func (c *Collection) GenerateKeys(URLs []string) (map[string]string, error)
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
func NewFileStorage ¶
func NewFileStorage(filename string) (*FileStorage, error)
func (*FileStorage) GetURLs ¶
func (fs *FileStorage) GetURLs(keys []string) (map[string]string, error)
func (*FileStorage) Restore ¶
func (fs *FileStorage) Restore() error
type FileStorageAsync ¶
type FileStorageAsync struct {
// contains filtered or unexported fields
}
func NewFileStorageAsync ¶
func NewFileStorageAsync(logger *utils.Logger, background *utils.Background, filename string) (*FileStorageAsync, error)
func (*FileStorageAsync) GetURLs ¶
func (fsa *FileStorageAsync) GetURLs(keys []string) (map[string]string, error)
func (*FileStorageAsync) Restore ¶
func (fsa *FileStorageAsync) Restore() error
type SQLStorage ¶
type SQLStorage struct {
// contains filtered or unexported fields
}
func NewSQLStorage ¶
func NewSQLStorage(db *sql.DB, timeout int) *SQLStorage
Click to show internal directories.
Click to hide internal directories.