url

package
v0.0.0-...-aa773c5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InitializationErr = errors.New("url: failed to initialize")
)

Functions

func CreateURL

func CreateURL[T Response[T]](id string, uuid string, target string, resp T, oldResp T) (T, T, error)

func FindURLByUUID

func FindURLByUUID[T Response[T]](uuid string, resp T) (T, error)

func PaginateURLs

func PaginateURLs[T Response[T]](page uint, resp []T) ([]T, int, error)

func RemoveURL

func RemoveURL[T Response[T]](id string, resp T) (T, error)

func SearchURLsBy

func SearchURLsBy[T Response[T]](term string, resp []T) ([]T, error)

func Start

func Start(ctx context.Context, env string, db *sqlx.DB, maxUrl uint, maxConcurrency uint, searchLimit int, redirectHost string) error

Start initializes all services in the domain

Types

type Response

type Response[T any] interface {
	SetID(id string) T
	SetUUID(uuid string) T
	SetTarget(target string) T
	SetCreatedAt(createdAt time.Time) T
}

Response interface represents entities.URL outside the domain.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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