Documentation
¶
Index ¶
- type Dialog
- func (g *Dialog) Create(ctx context.Context, obj dto.DialogCreate) (entity.Dialog, error)
- func (g *Dialog) GetByID(ctx context.Context, id int) (entity.Dialog, error)
- func (g *Dialog) List(ctx context.Context) ([]entity.Dialog, error)
- func (g *Dialog) Update(ctx context.Context, obj dto.DialogUpdate) error
- type DialogParticipantEventProducer
- type DialogRepository
- type Group
- func (g *Group) Create(ctx context.Context, obj dto.GroupCreate) (entity.Group, error)
- func (g *Group) Delete(ctx context.Context, id int) error
- func (g *Group) GetByID(ctx context.Context, id int) (entity.Group, error)
- func (g *Group) List(ctx context.Context) ([]entity.Group, error)
- func (g *Group) Update(ctx context.Context, obj dto.GroupUpdate) (entity.Group, error)
- type GroupParticipant
- func (p *GroupParticipant) Get(ctx context.Context, groupID, userID int) (entity.GroupParticipant, error)
- func (p *GroupParticipant) Invite(ctx context.Context, groupID, userID int) (entity.GroupParticipant, error)
- func (p *GroupParticipant) List(ctx context.Context, groupID int) ([]entity.GroupParticipant, error)
- func (p *GroupParticipant) UpdateStatus(ctx context.Context, groupID, userID int, status entity.GroupParticipantStatus) error
- type GroupParticipantConfig
- type GroupParticipantEventProducer
- type GroupParticipantFunc
- type GroupParticipantRepository
- type GroupRepository
- type InChatChecker
- type Message
- type MessageConsumer
- type MessagePublisher
- type MessageRepository
- type MessageServeManager
- type MessageServeManagerConfig
- type MessageSubscriber
- type ParticipantEventConsumer
- type SessionRepository
- type StatusMatrix
- type TransactionManager
- type User
- func (u *User) CheckPassword(ctx context.Context, username, password string) (userID string, ok bool, err error)
- func (u *User) Create(ctx context.Context, obj dto.UserCreate) (entity.User, error)
- func (u *User) Delete(ctx context.Context, id int) error
- func (u *User) GetByID(ctx context.Context, id int) (entity.User, error)
- func (u *User) List(ctx context.Context) ([]entity.User, error)
- func (u *User) Update(ctx context.Context, obj dto.UserUpdate) (entity.User, error)
- func (u *User) UpdatePassword(ctx context.Context, obj dto.UserUpdatePassword) error
- type UserConfig
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
func NewDialog ¶
func NewDialog(repo DialogRepository, prod DialogParticipantEventProducer) *Dialog
type DialogParticipantEventProducer ¶
type DialogParticipantEventProducer interface {
Produce(ctx context.Context, event entity.ParticipantEvent) error
}
type DialogRepository ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func NewGroup ¶
func NewGroup(repo GroupRepository, prod GroupParticipantEventProducer) *Group
type GroupParticipant ¶
type GroupParticipant struct {
// contains filtered or unexported fields
}
func NewGroupParticipant ¶
func NewGroupParticipant(conf GroupParticipantConfig) *GroupParticipant
func (*GroupParticipant) Get ¶
func (p *GroupParticipant) Get(ctx context.Context, groupID, userID int) (entity.GroupParticipant, error)
func (*GroupParticipant) Invite ¶
func (p *GroupParticipant) Invite(ctx context.Context, groupID, userID int) (entity.GroupParticipant, error)
func (*GroupParticipant) List ¶
func (p *GroupParticipant) List(ctx context.Context, groupID int) ([]entity.GroupParticipant, error)
func (*GroupParticipant) UpdateStatus ¶
func (p *GroupParticipant) UpdateStatus(ctx context.Context, groupID, userID int, status entity.GroupParticipantStatus) error
type GroupParticipantConfig ¶
type GroupParticipantConfig struct {
TxManager TransactionManager
Repository GroupParticipantRepository
EventProducer GroupParticipantEventProducer
}
type GroupParticipantEventProducer ¶
type GroupParticipantEventProducer interface {
Produce(ctx context.Context, event entity.ParticipantEvent) error
}
type GroupParticipantFunc ¶
type GroupParticipantFunc func(p *entity.GroupParticipant) error
type GroupParticipantRepository ¶
type GroupParticipantRepository interface {
List(ctx context.Context, groupID int) ([]entity.GroupParticipant, error)
Get(ctx context.Context, groupID, userID int, withLock bool) (entity.GroupParticipant, error)
Create(ctx context.Context, p *entity.GroupParticipant) error
Update(ctx context.Context, p *entity.GroupParticipant) error
}
type GroupRepository ¶
type InChatChecker ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage(repo MessageRepository, publisher MessagePublisher, checker InChatChecker) *Message
type MessageConsumer ¶
type MessagePublisher ¶
type MessageRepository ¶
type MessageServeManager ¶
type MessageServeManager struct {
// contains filtered or unexported fields
}
func NewMessageServeManager ¶
func NewMessageServeManager(conf MessageServeManagerConfig) *MessageServeManager
func (*MessageServeManager) BeginServe ¶
func (sm *MessageServeManager) BeginServe(ctx context.Context, inCh <-chan dto.MessageCreate) (<-chan entity.Message, <-chan error, error)
type MessageServeManagerConfig ¶
type MessageServeManagerConfig struct {
Service *Message
EventConsumer ParticipantEventConsumer
Subscriber MessageSubscriber
GroupRepository GroupRepository
DialogRepository DialogRepository
}
type MessageSubscriber ¶
type MessageSubscriber interface {
Subscribe(ctx context.Context, chatIDs ...entity.ChatID) MessageConsumer
}
type SessionRepository ¶
type StatusMatrix ¶
type StatusMatrix interface {
IsCorrectTransit(from, to entity.GroupParticipantStatus) bool
}
type TransactionManager ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
func NewUser ¶
func NewUser(conf UserConfig) *User
func (*User) CheckPassword ¶
func (*User) UpdatePassword ¶
type UserConfig ¶
type UserConfig struct {
UserRepository UserRepository
SessionRepository SessionRepository
}
type UserRepository ¶
type UserRepository interface {
List(ctx context.Context) ([]entity.User, error)
Create(ctx context.Context, user *entity.User) error
GetByID(ctx context.Context, id int) (entity.User, error)
GetByUsername(ctx context.Context, username string) (entity.User, error)
Update(ctx context.Context, user *entity.User) error
UpdatePassword(ctx context.Context, userID int, pwdHash string) error
Delete(ctx context.Context, id int) error
}
Click to show internal directories.
Click to hide internal directories.