service

package
v0.0.0-...-e7c2cf1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRefMatchId         = fmt.Errorf("%w:invalid matchId", common.ErrRefNotFound23503)
	ErrInvalidMatchStatus = errors.New("not yet accepted/revealed in matchId")
)

Functions

func NewS3

func NewS3(bucketName string) *attachment

Types

type Attachment

type Attachment interface {
	UploadBlob(file io.Reader, attach attachmentEntity.Uploader) (string, error)
	DeleteBlob(key string) error
	GetPresignedUrl(key string) (string, error)
}

type Auth

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

func NewAuth

func NewAuth(authR authentication.Repository, userR user.Repository, tokenSvc *Jwt) *Auth

func (*Auth) Login

func (a *Auth) Login(email, password string) (accessToken string, refreshToken string, err error)

func (*Auth) Logout

func (a *Auth) Logout(refreshToken string) error

func (*Auth) RevalidateRefreshToken

func (a *Auth) RevalidateRefreshToken(refreshToken string) (string, error)

type BasicInfo

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

func NewBasicInfo

func NewBasicInfo(bInfoRepo basicinfo.Repository) *BasicInfo

func (*BasicInfo) CreateBasicInfo

func (b *BasicInfo) CreateBasicInfo(bInfo basicInfoEntity.DTO) error

func (*BasicInfo) GetBasicInfoByUserId

func (b *BasicInfo) GetBasicInfoByUserId(id string) (basicInfoEntity.DTO, error)

func (*BasicInfo) UpdateBasicInfo

func (b *BasicInfo) UpdateBasicInfo(userId string, newBasicInfo basicInfoEntity.Update) error

type Chat

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

func NewChat

func NewChat(chatRepo chat.Repository, matchRepo match.Repository) *Chat

func (*Chat) CreateNewChat

func (c *Chat) CreateNewChat(content *chatEntity.DTO) error

func (*Chat) DeleteMessagesById

func (c *Chat) DeleteMessagesById(chatId string) error

func (*Chat) GetMessages

func (c *Chat) GetMessages(convoId string, filter chat.Filter) ([]chatEntity.DTO, error)

func (*Chat) UpdateSeenChat

func (c *Chat) UpdateSeenChat(convId, userId string) error

type Conversation

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

func NewConversation

func NewConversation(convRepo conversation.Repository, matchRepo match.Repository) *Conversation

func (*Conversation) CreateConversation

func (c *Conversation) CreateConversation(matchId string) (string, error)

func (*Conversation) DeleteConversationById

func (c *Conversation) DeleteConversationById(convoId string) error

func (*Conversation) FindConversationById

func (c *Conversation) FindConversationById(matchId string) (convEntity.DTO, error)

func (*Conversation) GetConversationByUserId

func (c *Conversation) GetConversationByUserId(userId string) ([]convEntity.DTO, error)

func (*Conversation) UpdateConvDay

func (c *Conversation) UpdateConvDay(convoId string) error

func (*Conversation) UpdateConvRow

func (c *Conversation) UpdateConvRow(convoId string) error

type EventDeps

type EventDeps struct {
	UserSvc  *User
	ConvSvc  *Conversation
	MatchSvc *Match
	Online   *Online
	Ws       *Ws
}

func (*EventDeps) HandleCreateChatEvent

func (d *EventDeps) HandleCreateChatEvent(payload event.ChatCreatedPayload)

func (*EventDeps) HandleProfileUpdateEvent

func (d *EventDeps) HandleProfileUpdateEvent(payload event.ProfileUpdatedPayload)

func (*EventDeps) HandleRevealUpdateEvent

func (d *EventDeps) HandleRevealUpdateEvent(payload event.MatchRevealedPayload)

func (*EventDeps) HandleSeenAtevent

func (d *EventDeps) HandleSeenAtevent(payload event.ChatSeenPayload)

type Interest

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

func NewInterest

func NewInterest(intrRepo interest.Repository) *Interest

func (*Interest) CreateNewBio

func (i *Interest) CreateNewBio(intr *interestEntity.BioDTO) error

func (*Interest) CreateNewHobbies

func (i *Interest) CreateNewHobbies(interestId string, hobbies []string) ([]interestEntity.HobbieDTO, error)

func (*Interest) CreateNewMovieSeries

func (i *Interest) CreateNewMovieSeries(interestId string, movieSeries []string) ([]interestEntity.MovieSerieDTO, error)

func (*Interest) CreateNewSports

func (i *Interest) CreateNewSports(interestId string, sports []string) ([]interestEntity.SportDTO, error)

func (*Interest) CreateNewTraveling

func (i *Interest) CreateNewTraveling(interestId string, travels []string) ([]interestEntity.TravelDTO, error)

func (*Interest) DeleteHobbies

func (i *Interest) DeleteHobbies(interestId string, ids []string) ([]string, error)

func (*Interest) DeleteMovieSeries

func (i *Interest) DeleteMovieSeries(interestId string, ids []string) ([]string, error)

func (*Interest) DeleteSports

func (i *Interest) DeleteSports(interestId string, ids []string) ([]string, error)

func (*Interest) DeleteTravels

func (i *Interest) DeleteTravels(interestId string, ids []string) ([]string, error)

func (*Interest) GetBio

func (i *Interest) GetBio(userId string) (interestEntity.BioDTO, error)

func (*Interest) GetInterest

func (i *Interest) GetInterest(userId string) (interestEntity.FullDTO, error)

func (*Interest) PutBio

func (i *Interest) PutBio(bio interestEntity.BioDTO) error

func (*Interest) PutHobbies

func (i *Interest) PutHobbies(interestId string, hobbies []interestEntity.HobbieDTO) error

func (*Interest) PutMovieSeries

func (i *Interest) PutMovieSeries(interestId string, movieSeries []interestEntity.MovieSerieDTO) error

func (*Interest) PutSports

func (i *Interest) PutSports(interestId string, sports []interestEntity.SportDTO) error

func (*Interest) PutTraveling

func (i *Interest) PutTraveling(interestId string, travels []interestEntity.TravelDTO) error

type Jwt

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

func NewJwt

func NewJwt(accessSecret, refreshSecret, accessExpires, refreshExpires string) *Jwt

func (*Jwt) GenerateAccessToken

func (j *Jwt) GenerateAccessToken(id string) (string, error)

func (*Jwt) GenerateRefreshToken

func (j *Jwt) GenerateRefreshToken(id string) (string, error)

func (*Jwt) ValidateAccessToken

func (j *Jwt) ValidateAccessToken(token string) (string, error)

func (*Jwt) ValidateRefreshToken

func (j *Jwt) ValidateRefreshToken(token string) (string, error)

type Location

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

func NewLocation

func NewLocation(locationRepo location.Repository) *Location

func (*Location) CreateNewLocation

func (l *Location) CreateNewLocation(location *locationEntity.DTO) error

func (*Location) GetLocation

func (l *Location) GetLocation(id string) (locationEntity.DTO, error)

func (*Location) UpdateLocation

func (l *Location) UpdateLocation(userId string, changeLat, changeLng *string) error

type Match

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

func NewMatch

func NewMatch(matchRepo match.Repository, locationRepo location.Repository) *Match

func (*Match) FindUserToMatch

func (m *Match) FindUserToMatch(userId string) ([]matchEntity.UserDTO, error)

func (*Match) GetMatchById

func (m *Match) GetMatchById(matchId string) (matchEntity.MatchDAO, error)

func (*Match) GetMatchReqToUserId

func (m *Match) GetMatchReqToUserId(userId string) ([]matchEntity.FullUserDTO, error)

func (*Match) PostNewMatch

func (m *Match) PostNewMatch(fromUserId, toUserId string, matchStatus matchEntity.Status) (string, error)

func (*Match) RequestChange

func (m *Match) RequestChange(matchId string, matchStatus matchEntity.Status) error

func (*Match) RevealChange

func (m *Match) RevealChange(matchId string, matchStatus matchEntity.Status) error

type Online

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

func NewOnline

func NewOnline(onlineRepo online.Repository) *Online

func (*Online) CreateNewOnline

func (o *Online) CreateNewOnline(userId string) error

func (*Online) GetOnline

func (o *Online) GetOnline(userId string) (onlineEntities.DTO, error)

func (*Online) PutOnline

func (o *Online) PutOnline(userId string, online bool) error

type User

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

func NewUser

func NewUser(userRepo user.Repository) *User

func (*User) CreateNewProfilePic

func (u *User) CreateNewProfilePic(profPicParam userEntity.ProfilePic) (string, error)

func (*User) CreateUser

func (u *User) CreateUser(newUser userEntity.Register) (string, error)

func (*User) GetUserById

func (u *User) GetUserById(id string) (userEntity.FullDTO, error)

func (*User) GetUserByIdWithSelectedProfPic

func (u *User) GetUserByIdWithSelectedProfPic(id string) (userEntity.FullDTO, error)

func (*User) UpdateUser

func (u *User) UpdateUser(userId string, updateUser userEntity.Update) error

type Ws

type Ws struct {
	Clients       *rwmap.RwMap[websocketEntity.Conn, string]
	ReverseClient *rwmap.RwMap[string, websocketEntity.Conn]
	WsChan        chan websocketEntity.Payload
}

func NewWs

func NewWs() *Ws

func (*Ws) ListenForWsPayload

func (ws *Ws) ListenForWsPayload(conn *websocketEntity.Conn)

func (*Ws) PingTicker

func (ws *Ws) PingTicker(conn *websocketEntity.Conn)

Directories

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

Jump to

Keyboard shortcuts

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