service

package
v0.0.0-...-c3818ae Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	URL
	User
}

func NewService

func NewService(conf config.Config, repos *repository.Repository) *Service

type URL

type URL interface {
	CreateShortURL(url domain.URL) string
	GetURLByHash(hash string) (domain.URL, error)
}

type URLService

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

func NewURLService

func NewURLService(conf config.Config, repo *repository.Repository) *URLService

func (*URLService) CreateShortURL

func (s *URLService) CreateShortURL(url domain.URL) string

func (*URLService) GetURLByHash

func (s *URLService) GetURLByHash(hash string) (domain.URL, error)

type User

type User interface {
	Create(user domain.User) (interface{}, error)
	GenerateToken(username, password string) (string, error)
	ParseToken(accessToken string) (interface{}, error)
}

type UserService

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

func NewUserService

func NewUserService(repo *repository.Repository) *UserService

func (*UserService) Create

func (s *UserService) Create(user domain.User) (interface{}, error)

func (*UserService) GenerateToken

func (s *UserService) GenerateToken(username, password string) (string, error)

func (*UserService) ParseToken

func (s *UserService) ParseToken(accessToken string) (interface{}, error)

Jump to

Keyboard shortcuts

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