service

package
v0.0.0-...-22fc0f8 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAccess          = errors.New("not the owner of this object")
	ErrIDNotFound        = repository.ErrIDNotFound
	NoContentPlaceholder = "~~~~~~~~\n~~~~~~~~"
)
View Source
var (
	ErrDuplicatedUser        = repository.ErrDuplicatedUser
	ErrInvalidUserOrPassword = errors.New("wrong email or password")
)

Functions

This section is empty.

Types

type PostitCreate

type PostitCreate struct {
	QuestionID int64  `json:"question_id" binding:"required"`
	Content    string `json:"content"`
	IsVisible  bool   `json:"is_visible"`
}

type PostitUpdate

type PostitUpdate struct {
	Content   string `json:"content"`
	IsVisible bool   `json:"is_visible"`
}

type RetroService

type RetroService interface {
	CreateTemplate(ctx context.Context, template repository.Template) (repository.Template, error)
	GetTemplates(ctx context.Context) ([]repository.Template, error)
	DeleteTemplateByID(ctx context.Context, tid int64, uid int64) error
	GetTemplateByID(ctx context.Context, tid int64, uid int64) (repository.Template, error)

	CreateRetro(ctx context.Context, tid int64, uid int64, name string) (repository.Retro, error)
	GetRetros(ctx context.Context) ([]repository.Retro, error)
	GetRetroByID(ctx context.Context, tid int64, uid int64) (repository.Retro, error)
	DeleteRetroByID(ctx context.Context, tid int64, uid int64) error
	GetTopVotePostits(ctx context.Context, rid int64, n int) ([]repository.Postit, error)

	CreatePostit(ctx context.Context, postit PostitCreate, uid int64) (repository.Postit, error)
	DeletePostitByID(ctx context.Context, pid int64, uid int64) error
	UpdatePostit(
		ctx context.Context,
		pid int64,
		postit PostitUpdate,
		uid int64,
	) (repository.Postit, error)
	VotePostitByID(ctx context.Context, pid int64) error
}

func NewRetroService

func NewRetroService(repo repository.RetroRepository) RetroService

type UserService

type UserService interface {
	SignUp(ctx context.Context, u repository.User) (repository.User, error)
	Login(ctx context.Context, username string, password string) (repository.User, error)
}

func NewUserService

func NewUserService(repo repository.UserRepository) UserService

Jump to

Keyboard shortcuts

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