service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	CreateUser(user entities.User) (int, error)
	GenerateToken(use entities.User) (string, error)
	ParseToken(token string) (int, error)
}

type AuthService

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

func NewAuthService

func NewAuthService(repo repository.Auth) *AuthService

func (*AuthService) CreateUser

func (s *AuthService) CreateUser(user entities.User) (int, error)

func (*AuthService) GenerateToken

func (s *AuthService) GenerateToken(user entities.User) (string, error)

func (*AuthService) ParseToken

func (s *AuthService) ParseToken(token string) (int, error)

type Book

type Book interface {
	GetBook(id int) (*entities.Book, error)
	GetBooks() ([]*entities.Book, error)
	CreateBook(book entities.Book) (int, error)
	UpdateBook(book entities.Book) error
	DeleteBook(id int) error
}

type BookService

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

func NewBookService

func NewBookService(repo repository.Book) *BookService

func (*BookService) CreateBook

func (s *BookService) CreateBook(book entities.Book) (int, error)

func (*BookService) DeleteBook

func (s *BookService) DeleteBook(id int) error

func (*BookService) GetBook

func (s *BookService) GetBook(id int) (*entities.Book, error)

func (*BookService) GetBooks

func (s *BookService) GetBooks() ([]*entities.Book, error)

func (*BookService) UpdateBook

func (s *BookService) UpdateBook(book entities.Book) error

type Service

type Service struct {
	Book
	Auth
}

func NewService

func NewService(repo *repository.Repository) *Service

Jump to

Keyboard shortcuts

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