Documentation
¶
Index ¶
- Variables
- type CreateInput
- type Service
- func NewService(repo storage.InstanceRepository) *Service
- func NewServiceWithSession(repo storage.InstanceRepository, session SessionManager) *Service
- func NewServiceWithSessionAndMessages(repo storage.InstanceRepository, messageRepo storage.MessageRepository, ...) *Service
- func NewServiceWithSessionMessagesAndEventLogs(repo storage.InstanceRepository, messageRepo storage.MessageRepository, ...) *Service
- func (s *Service) Create(ctx context.Context, input CreateInput) (model.Instance, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) DeleteByUser(ctx context.Context, id string, userID string, userRole string) error
- func (s *Service) Disconnect(ctx context.Context, id string) error
- func (s *Service) DisconnectByUser(ctx context.Context, id string, userID string, userRole string) error
- func (s *Service) Get(ctx context.Context, id string) (model.Instance, error)
- func (s *Service) GetByUser(ctx context.Context, id string, userID string, userRole string) (model.Instance, error)
- func (s *Service) GetQR(ctx context.Context, id string) (string, error)
- func (s *Service) GetQRByUser(ctx context.Context, id string, userID string, userRole string) (string, error)
- func (s *Service) List(ctx context.Context) ([]model.Instance, error)
- func (s *Service) ListByUser(ctx context.Context, userID string, userRole string) ([]model.Instance, error)
- func (s *Service) RotateToken(ctx context.Context, id string) (string, error)
- func (s *Service) RotateTokenByUser(ctx context.Context, id string, userID string, userRole string) (string, error)
- func (s *Service) Update(ctx context.Context, id string, input UpdateInput) (model.Instance, error)
- func (s *Service) UpdateByUser(ctx context.Context, id string, input UpdateInput) (model.Instance, error)
- func (s *Service) UpdateStatus(ctx context.Context, id string, status model.InstanceStatus) (model.Instance, error)
- type SessionManager
- type UpdateInput
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidName = errors.New("nome da instância inválido")
Functions ¶
This section is empty.
Types ¶
type CreateInput ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo storage.InstanceRepository) *Service
func NewServiceWithSession ¶
func NewServiceWithSession(repo storage.InstanceRepository, session SessionManager) *Service
func NewServiceWithSessionAndMessages ¶
func NewServiceWithSessionAndMessages(repo storage.InstanceRepository, messageRepo storage.MessageRepository, session SessionManager) *Service
func NewServiceWithSessionMessagesAndEventLogs ¶
func NewServiceWithSessionMessagesAndEventLogs(repo storage.InstanceRepository, messageRepo storage.MessageRepository, eventLogRepo storage.EventLogRepository, session SessionManager) *Service
func (*Service) DeleteByUser ¶
func (*Service) DisconnectByUser ¶
func (*Service) GetQRByUser ¶
func (*Service) ListByUser ¶
func (*Service) RotateToken ¶
func (*Service) RotateTokenByUser ¶
func (*Service) UpdateByUser ¶
type SessionManager ¶
type SessionManager interface {
CreateSession(ctx context.Context, instanceID string) (string, error)
GetQR(ctx context.Context, instanceID string) (string, error)
RestoreSession(ctx context.Context, instanceID string, encryptedBlob []byte) error
Disconnect(instanceID string) error
DeleteSession(instanceID string) error
SaveSessionBlob(instanceID string) ([]byte, error)
}
Click to show internal directories.
Click to hide internal directories.