usecase

package
v0.0.0-...-e10dee8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	GenerateShortURL(url string) string
}

type LinkRepository

type LinkRepository interface {
	GetLink(ctx context.Context, token string) (*model.Link, error)
	StoreLink(ctx context.Context, link *model.Link) error
	StartRecalculation(interval time.Duration, deleted chan []string)
}

type LinkService

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

func NewLinkService

func NewLinkService(cfg *config.Config, repo LinkRepository, strGenerator Generator) *LinkService
func (service *LinkService) CreateShortLink(ctx context.Context, linkRequest *dto.CreateLinkRequest) (*model.Link, error)
func (service *LinkService) GetFullLink(ctx context.Context, token string) (string, error)

Directories

Path Synopsis
Package mock_usecase is a generated GoMock package.
Package mock_usecase is a generated GoMock package.

Jump to

Keyboard shortcuts

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