repository

package
v0.0.0-...-ee164ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysqlDb

func NewMysqlDb(cfg Config) (*sqlx.DB, error)

Types

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	Db       string
}
type Link interface {
	CropLink(link string) (string, error)
	GetLink(link string) (model.Link, error)
	GenerateCode() string
	RedirectLink(code string) (string, error)
}

type LinkMysql

type LinkMysql struct {
	// contains filtered or unexported fields
}

func NewLinkMysql

func NewLinkMysql(db *sqlx.DB) *LinkMysql
func (r *LinkMysql) CropLink(link string) (string, error)

func (*LinkMysql) GenerateCode

func (r *LinkMysql) GenerateCode() string
func (r *LinkMysql) GetLink(link string) (model.Link, error)
func (r *LinkMysql) RedirectLink(code string) (string, error)

type Repository

type Repository struct {
	Link
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL