service

package
v0.0.0-...-a1e0f3c Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

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

AuthService - service

func NewAuthService

func NewAuthService(repo repository.Authorization) *AuthService

NewAuthService - constructor

func (*AuthService) CreateUser

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

CreateUser - just creating user

func (*AuthService) GenerateToken

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

GenerateToken - token generation

func (*AuthService) ParseToken

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

type Author

type Author interface {
}

Author - author commands (not implemented, because is not required)

type AuthorService

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

AuthorService - just service

func NewAuthorService

func NewAuthorService(repo repository.Author) *AuthorService

NewAuthorService - constructor

type Authorization

type Authorization interface {
	CreateUser(user models.User) (int, error)
	GenerateToken(username, password string) (string, error)
	ParseToken(token string) (int, error)
}

Authorization - signup/signin

type Book

type Book interface {
	CreateBook(book models.Book) (int, error)
	GetAllBook() ([]models.Book, error)
	GetBookById(bookId int) (models.Book, error)
	DeleteBook(bookId int) error
	UpdateBook(bookId int, book models.Book) error
}

Book - book commands

type BookService

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

BookService - just book service

func NewBookService

func NewBookService(repo repository.Book, authorRepo repository.Author) *BookService

NewBookService - constructor

func (*BookService) CreateBook

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

CreateBook - create book

func (*BookService) DeleteBook

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

DeleteBook - book

func (*BookService) GetAllBook

func (s *BookService) GetAllBook() ([]models.Book, error)

GetAllBook - getting all books

func (*BookService) GetBookById

func (s *BookService) GetBookById(bookId int) (models.Book, error)

GetBookById - get book

func (*BookService) UpdateBook

func (s *BookService) UpdateBook(bookId int, book models.Book) error

UpdateBook - book

type Service

type Service struct {
	Authorization
	Book
	Author
}

Service - just service

func NewService

func NewService(repos *repository.Repository) *Service

NewService - constructor

Directories

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

Jump to

Keyboard shortcuts

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