service

package
v0.0.0-...-6a26343 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetService

type AssetService interface {
	PersistImage([]*multipart.FileHeader, string) *errs.AppError
}

type AuthService

type AuthService interface {
	Login(dto.Auth) (*dto.Auth, *dto.User, *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) (*dto.Comment, *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 DefaultAssetService

type DefaultAssetService struct{}

func NewAssetService

func NewAssetService() DefaultAssetService

func (DefaultAssetService) PersistImage

func (a DefaultAssetService) PersistImage(fileHeaders []*multipart.FileHeader, path string) *errs.AppError

type DefaultAuthService

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

func NewAuthService

func NewAuthService(repo data.AuthRepositoryDB) DefaultAuthService

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(authDTO dto.Auth) (*dto.Auth, *dto.User, *errs.AppError)

type DefaultCommentService

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

func (DefaultCommentService) CreateComment

func (service DefaultCommentService) CreateComment(body []byte) (*dto.Comment, *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 data.UserRepository, broadcast chan dto.SocketMessage) 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) Register

func (service DefaultUserService) Register(body []byte) (*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(id uuid.UUID) (*dto.User, *errs.AppError)

type DefaultVoteService

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

func NewVoteService

func NewVoteService(repo data.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 dto.SocketMessage
	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(uuid.UUID) (*dto.User, *errs.AppError)
	Register([]byte) (*dto.NewUser, *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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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