service

package
v0.0.0-...-6c81faf Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublicIDSize          = 10
	StatusRedirected      = "redirected"
	StatusBlocked         = "blocked"
	StatusExpired         = "expired"
	StatusLimitReached    = "limit_reached"
	StatusDeleted         = "deleted"
	VersionStringify      = "%s %s"
	TransparentBackground = "transparent"
)

Variables

This section is empty.

Functions

func CountRedirects

func CountRedirects(accesses []entity.ShortyAccess) int

Types

type QRCodeService

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

func NewQRCodeService

func NewQRCodeService(logo string) *QRCodeService

func (*QRCodeService) Generate

func (q *QRCodeService) Generate(qr *request.QRCode, link string) (string, error)

type ShortyService

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

func NewShortyService

func NewShortyService(
	hostName,
	logo string,
	log *zap.Logger,
	shortyRepository *entity.ShortyRepository,
	shortyAccessRepository *entity.ShortyAccessRepository,
	qrSvc *QRCodeService,
) *ShortyService

func (*ShortyService) Create

func (s *ShortyService) Create(req *request.CreateShorty) (*entity.Shorty, error)

func (*ShortyService) CreateVisit

func (s *ShortyService) CreateVisit(publicID string, req *request.Redirect) (*entity.Shorty, error)

func (*ShortyService) DeleteShortyByUUID

func (s *ShortyService) DeleteShortyByUUID(id uuid.UUID) error

func (*ShortyService) FindAllAccessesByShortyID

func (s *ShortyService) FindAllAccessesByShortyID(id uuid.UUID) []entity.ShortyAccess

func (*ShortyService) FindShortyByID

func (s *ShortyService) FindShortyByID(id uuid.UUID) (*entity.Shorty, error)

func (*ShortyService) FindShortyByPublicID

func (s *ShortyService) FindShortyByPublicID(publicID string) (*entity.Shorty, error)

func (*ShortyService) List

func (s *ShortyService) List(limit, offset int) ([]*entity.Shorty, error)

func (*ShortyService) Update

Jump to

Keyboard shortcuts

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