Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheURLRepo ¶
func (CacheURLRepo) Get ¶
func (s CacheURLRepo) Get(shortURL string) (URLMapping, error)
func (CacheURLRepo) Save ¶
func (s CacheURLRepo) Save(shortURL string, urlMapping URLMapping, expTime time.Duration) error
func (CacheURLRepo) Update ¶
func (s CacheURLRepo) Update(shortURL string, urlMapping URLMapping) error
type SQLURLRepo ¶
func (SQLURLRepo) Get ¶
func (s SQLURLRepo) Get(shortURL string) (URLMapping, error)
func (SQLURLRepo) Save ¶
func (s SQLURLRepo) Save(shortURL string, urlMapping URLMapping, expTime time.Duration) error
func (SQLURLRepo) Update ¶
func (s SQLURLRepo) Update(shortURL string, urlMapping URLMapping) error
type URLDB ¶
type URLDB interface { Save(shortURL string, urlMapping URLMapping, expTime time.Duration) error Get(shortURL string) (URLMapping, error) Update(shortURL string, urlMapping URLMapping) error }
type URLMapping ¶
type URLMapping struct { OriginalURL string `json:"original_url"` Count int `json:"count"` ExpTime time.Time `json:"exp_time"` }
func (URLMapping) MarshalBinary ¶
func (s URLMapping) MarshalBinary() ([]byte, error)
func (*URLMapping) UnmarshalBinary ¶
func (s *URLMapping) UnmarshalBinary(data []byte) error
type URLRepo ¶
type URLRepo interface { Save(shortURL string, urlMapping URLMapping, expTime time.Duration) error Get(shortURL string) (URLMapping, error) Update(shortURL string, urlMapping URLMapping) error }
Click to show internal directories.
Click to hide internal directories.