package
Version:
v0.0.0-...-cf1b590
Opens a new window with list of versions in this module.
Published: Nov 26, 2024
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
DB struct to hold the database connection pool.
New creates a new DB instance.
Close closes the database connection pool.
GetOriginalURL gets the original URL from the short URL.
StoreURLs stores the short URL and original URL in the database.
Database interface to hold the database methods.
type URLMap struct {
CreatedAt time.Time `db:"created_at"`
ShortURL string `db:"short_url"`
OriginalURL string `db:"original_url"`
Hits int64 `db:"hits"`
}
URLMap struct to hold the URL map.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.