service

package
v0.0.0-...-fd8998a Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLinkNotFound           = errors.New("link not found")
	ErrShortLinkIsNotValid    = errors.New("short link is not valid")
	ErrOriginalLinkIsTooLong  = errors.New("original link is too long")
	ErrOriginalLinkIsNotValid = errors.New("original link is not valid")

	ErrEncodeError  = errors.New("encode error")
	ErrStorageError = errors.New("storage error")
)

Functions

This section is empty.

Types

type ShortenerService

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

func NewShortenerService

func NewShortenerService(storage storage.Storage, coder coder.Coder, linkValidator validator.Validator, config *config.Config) *ShortenerService
func (srv ShortenerService) GetFullLink(shortLink string) (string, error)
func (srv ShortenerService) ShortenLink(link string) (string, error)

Jump to

Keyboard shortcuts

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