Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository the repository structure to create and retrieve Shortened URLs
func New ¶
func New(db *gorm.DB) *Repository
New returns a new repository configured with the given 'db'
type ShortenedURL ¶
type ShortenedURL struct { ID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key"` CreatedAt time.Time LongURL string ShortURL string }
ShortenedURL the structure for shortened URLs
func (ShortenedURL) TableName ¶
func (ShortenedURL) TableName() string
TableName set ShortenedURL's table name to be `urls`
Click to show internal directories.
Click to hide internal directories.