services

package
v0.0.0-...-ab5ebe4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Categories

type Categories interface {
	Add(ctx context.Context, telegramChatID int64, name string) error
	Remove(ctx context.Context, telegramChatID int64, name string) error
	AddToBeRenamedToCategory(ctx context.Context, telegramChatID int64, name string) error
	Rename(ctx context.Context, telegramChatID int64, newName string) error
	List(ctx context.Context, telegramChatID int64) ([]core.Category, error)
}

type CategoryService

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

func NewCategoryService

func NewCategoryService(logger Logger, repo repository.Categories) *CategoryService

func (*CategoryService) Add

func (c *CategoryService) Add(ctx context.Context, telegramChatID int64, name string) error

func (*CategoryService) AddToBeRenamedToCategory

func (c *CategoryService) AddToBeRenamedToCategory(ctx context.Context, telegramChatID int64, name string) error

func (*CategoryService) List

func (c *CategoryService) List(ctx context.Context, telegramChatID int64) ([]core.Category, error)

func (*CategoryService) Remove

func (c *CategoryService) Remove(ctx context.Context, telegramChatID int64, name string) error

func (*CategoryService) Rename

func (c *CategoryService) Rename(ctx context.Context, telegramChatID int64, newName string) error

type Deps

type Deps struct {
	Repository *repository.Repository
	Logger
}

type InteractionService

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

func NewInteractionService

func NewInteractionService(logger Logger, repo repository.Interactions) *InteractionService

func (*InteractionService) Add

func (i *InteractionService) Add(ctx context.Context, telegramChatID int64, interactionID int) error

func (*InteractionService) Get

func (i *InteractionService) Get(ctx context.Context, telegramChatID int64) (int, error)

func (*InteractionService) Remove

func (i *InteractionService) Remove(ctx context.Context, telegramChatID int64) error

type Interactions

type Interactions interface {
	Add(ctx context.Context, telegramChatID int64, interactionID int) error
	Remove(ctx context.Context, telegramChatID int64) error
	Get(ctx context.Context, telegramChatID int64) (int, error)
}

type Logger

type Logger interface {
	Error(err error)
}

type NoteService

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

func NewNoteService

func NewNoteService(logger Logger, repo repository.Notes) *NoteService

func (*NoteService) Add

func (n *NoteService) Add(ctx context.Context, telegramChatID int64, categoryName, content string) error

func (*NoteService) ListInCategory

func (n *NoteService) ListInCategory(
	ctx context.Context,
	telegramChatID int64,
	categoryName string,
) ([]core.Note, error)

func (*NoteService) Remove

func (n *NoteService) Remove(ctx context.Context, telegramChatID int64, categoryName, content string) error

type Notes

type Notes interface {
	Add(ctx context.Context, telegramChatID int64, categoryName, content string) error
	Remove(ctx context.Context, telegramChatID int64, categoryName, content string) error
	ListInCategory(ctx context.Context, telegramChatID int64, categoryName string) ([]core.Note, error)
}

type Services

type Services struct {
	Categories
	Notes
	Users
	Interactions
}

func NewServices

func NewServices(deps Deps) *Services

type UserService

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

func NewUserService

func NewUserService(logger Logger, repo repository.Users) *UserService

func (*UserService) CheckChatIDExists

func (u *UserService) CheckChatIDExists(ctx context.Context, telegramChatID int64) error

func (*UserService) CreateIfNotExists

func (u *UserService) CreateIfNotExists(ctx context.Context, telegramChatID int64) error

type Users

type Users interface {
	CreateIfNotExists(ctx context.Context, telegramChatID int64) error
	CheckChatIDExists(ctx context.Context, telegramChatID int64) error
}

Directories

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

Jump to

Keyboard shortcuts

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