Documentation
¶
Index ¶
- Variables
- type Database
- type Shortened
- type ShortenedRepo
- type SqlShortenedRepo
- func (repo SqlShortenedRepo) Add(ctx context.Context, shortened Shortened) error
- func (repo SqlShortenedRepo) Delete(ctx context.Context, shortened Shortened) error
- func (repo SqlShortenedRepo) Find(ctx context.Context, shortUrl string) (Shortened, error)
- func (repo SqlShortenedRepo) FindByOriginal(ctx context.Context, url string) (Shortened, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Database Connection ErrorDatabaseDriverInvalid = errors.New("given database driver is invalid") ErrorDatabaseSourceInvalid = errors.New("given database source is invalid") ErrorConnectionFailed = errors.New("can not connect to database") // Migrations ErrorMigrationFailed = errors.New("failed to migrate database") // Query operations ErrorRecordNotFound = errors.New("record with given query not found") ErrorOperationFailed = errors.New("operation failed") // context ErrorOperationCanceled = errors.New("operation canceled") // Validations ErrorInvalidShortened = errors.New("invalid shortened") )
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
ShortenedRepo ShortenedRepo
// contains filtered or unexported fields
}
type Shortened ¶
type ShortenedRepo ¶
type SqlShortenedRepo ¶
type SqlShortenedRepo struct {
// contains filtered or unexported fields
}
func NewSqlShortenedRepo ¶
func NewSqlShortenedRepo(db *gorm.DB) *SqlShortenedRepo
func (SqlShortenedRepo) Add ¶
func (repo SqlShortenedRepo) Add(ctx context.Context, shortened Shortened) error
func (SqlShortenedRepo) Delete ¶
func (repo SqlShortenedRepo) Delete(ctx context.Context, shortened Shortened) error
func (SqlShortenedRepo) FindByOriginal ¶
Click to show internal directories.
Click to hide internal directories.