service

package
v0.0.0-...-c3373ee Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Links interface {
	CreateLink(originLink string) (string, error)
	GetLink(shortLink string) (string, error)
	GetQR(shortLink string) ([]byte, string, error)
	RemoveLink(id int) error
}

type LinksService

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

service

func NewLinksService

func NewLinksService(repo repository.Links) *LinksService
func (l *LinksService) CreateLink(originLink string) (string, error)

methods

func (l *LinksService) GetLink(shortLink string) (string, error)

func (*LinksService) GetQR

func (l *LinksService) GetQR(shortLink string) ([]byte, string, error)
func (l *LinksService) RemoveLink(id int) error

type Service

type Service struct {
	Links
}

func NewService

func NewService(repos *repository.Repository) *Service