service

package
v0.0.0-...-eb3de9a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: AGPL-3.0 Imports: 24 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 interface {
	Login([]byte) (*dto.Auth, *dto.User, *errs.AppError)
	Register([]byte) (*dto.NewUser, *errs.AppError)
	Authorize(string) (*dto.Auth, *errs.AppError)
	AuthorizeChat(string, string) *errs.AppError
}

type ChatClient

type ChatClient struct {
	Room    *Room
	UserId  uuid.UUID
	Conn    *websocket.Conn
	Send    chan []byte
	ComServ CommentService
}

func (*ChatClient) Pub

func (c *ChatClient) Pub()

func (*ChatClient) Sub

func (c *ChatClient) Sub()

type CommentService

type CommentService interface {
	FindAllComments() ([]dto.Comment, *errs.AppError)
	CreateComment([]byte) ([]byte, *errs.AppError)
	DeleteComment(string) *errs.AppError
	FindCommentsAfter(json.RawMessage) ([]byte, *errs.AppError)
}

type CountryService

type CountryService interface {
	GetAllCountries() (*[]dto.Country, *errs.AppError)
	UpdateCountry([]byte) (*dto.Country, *errs.AppError)
	SingleCountry(string) (*dto.Country, *errs.AppError)
	Participating() (*[]dto.Country, *errs.AppError)
}

type DefaultAuthService

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

func (DefaultAuthService) Authorize

func (das DefaultAuthService) Authorize(token string) (*dto.Auth, *errs.AppError)

func (DefaultAuthService) AuthorizeChat

func (das DefaultAuthService) AuthorizeChat(token string, userId string) *errs.AppError

func (DefaultAuthService) Login

func (das DefaultAuthService) Login(body []byte) (*dto.Auth, *dto.User, *errs.AppError)

func (DefaultAuthService) Register

func (das DefaultAuthService) Register(body []byte) (*dto.NewUser, *errs.AppError)

type DefaultCommentService

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

func (DefaultCommentService) CreateComment

func (service DefaultCommentService) CreateComment(body []byte) ([]byte, *errs.AppError)

func (DefaultCommentService) DeleteComment

func (service DefaultCommentService) DeleteComment(uuid string) *errs.AppError

func (DefaultCommentService) FindAllComments

func (service DefaultCommentService) FindAllComments() ([]dto.Comment, *errs.AppError)

func (DefaultCommentService) FindCommentsAfter

func (service DefaultCommentService) FindCommentsAfter(commentIdJSON json.RawMessage) ([]byte, *errs.AppError)

type DefaultCountryService

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

func (DefaultCountryService) GetAllCountries

func (service DefaultCountryService) GetAllCountries() (*[]dto.Country, *errs.AppError)

func (DefaultCountryService) Participating

func (service DefaultCountryService) Participating() (*[]dto.Country, *errs.AppError)

func (DefaultCountryService) SingleCountry

func (service DefaultCountryService) SingleCountry(slug string) (*dto.Country, *errs.AppError)

func (DefaultCountryService) UpdateCountry

func (service DefaultCountryService) UpdateCountry(body []byte) (*dto.Country, *errs.AppError)

type DefaultUserService

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

func NewUserService

func NewUserService(repo domain.UserRepository, broadcast chan []byte) DefaultUserService

func (DefaultUserService) DeleteUser

func (service DefaultUserService) DeleteUser(slug string) *errs.AppError

func (DefaultUserService) GetAllUsers

func (service DefaultUserService) GetAllUsers() (map[uuid.UUID]dto.User, *errs.AppError)

func (DefaultUserService) GetRegisteredUsers

func (service DefaultUserService) GetRegisteredUsers() ([]*dto.NewUser, *errs.AppError)

func (DefaultUserService) SingleUser

func (service DefaultUserService) SingleUser(slug string) (*dto.User, *errs.AppError)

func (DefaultUserService) UpdateUser

func (service DefaultUserService) UpdateUser(userDTO dto.User) (*dto.User, *errs.AppError)

func (DefaultUserService) UpdateUserImage

func (service DefaultUserService) UpdateUserImage(avatarDTO dto.UserAvatar) (*dto.User, *errs.AppError)

type DefaultVoteService

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

func NewVoteService

func NewVoteService(repo domain.VoteRepository) DefaultVoteService

func (DefaultVoteService) GetResults

func (service DefaultVoteService) GetResults() (*[]dto.Result, *errs.AppError)

func (DefaultVoteService) GetResultsByUser

func (service DefaultVoteService) GetResultsByUser(userId string) (*[]dto.Result, *errs.AppError)

func (DefaultVoteService) GetVoteByUserAndCountry

func (service DefaultVoteService) GetVoteByUserAndCountry(userId uuid.UUID, countrySlug string) (*dto.Vote, *errs.AppError)

func (DefaultVoteService) UpdateVote

func (service DefaultVoteService) UpdateVote(voteSingleDTO dto.VoteSingle) (*dto.Vote, *errs.AppError)

type Room

type Room struct {
	CommentService CommentService

	BroadcastUpdate chan []byte
	Register        chan *ChatClient
	// contains filtered or unexported fields
}

func NewRoom

func NewRoom(commentService CommentService) *Room

func (*Room) Run

func (r *Room) Run()

type UserService

type UserService interface {
	GetAllUsers() (map[uuid.UUID]dto.User, *errs.AppError)
	UpdateUser(dto.User) (*dto.User, *errs.AppError)
	SingleUser(string) (*dto.User, *errs.AppError)
	DeleteUser(string) *errs.AppError
	GetRegisteredUsers() ([]*dto.NewUser, *errs.AppError)
	UpdateUserImage(image dto.UserAvatar) (*dto.User, *errs.AppError)
}

type VoteService

type VoteService interface {
	UpdateVote(dto.VoteSingle) (*dto.Vote, *errs.AppError)
	GetVoteByUserAndCountry(uuid.UUID, string) (*dto.Vote, *errs.AppError)
	GetResults() (*[]dto.Result, *errs.AppError)
	GetResultsByUser(userId string) (*[]dto.Result, *errs.AppError)
}

Jump to

Keyboard shortcuts

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