Documentation ¶
Index ¶
- Constants
- Variables
- type EnqueueOptions
- type ErrValidation
- type HashingTask
- type HashingTaskConfig
- type HashingTaskParams
- type Service
- func (s *Service) Enqeue(device models.Device, message smsgateway.Message, opts EnqueueOptions) (smsgateway.MessageState, error)
- func (s *Service) GetState(user models.User, ID string) (smsgateway.MessageState, error)
- func (s *Service) RunBackgroundTasks(ctx context.Context, wg *sync.WaitGroup)
- func (s *Service) SelectPending(deviceID string) ([]smsgateway.Message, error)
- func (s *Service) UpdateState(deviceID string, message smsgateway.MessageState) error
- type ServiceParams
Constants ¶
View Source
const (
ErrorTTLExpired = "TTL expired"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type EnqueueOptions ¶
type EnqueueOptions struct {
SkipPhoneValidation bool
}
type ErrValidation ¶
type ErrValidation string
func (ErrValidation) Error ¶
func (e ErrValidation) Error() string
type HashingTask ¶
type HashingTask struct { Messages *repositories.MessagesRepository Config HashingTaskConfig Logger *zap.Logger // contains filtered or unexported fields }
func NewHashingTask ¶
func NewHashingTask(params HashingTaskParams) *HashingTask
func (*HashingTask) Enqeue ¶
func (t *HashingTask) Enqeue(id uint64)
func (*HashingTask) Run ¶
func (t *HashingTask) Run(ctx context.Context)
type HashingTaskConfig ¶
type HashingTaskParams ¶
type HashingTaskParams struct { fx.In Messages *repositories.MessagesRepository Config HashingTaskConfig Logger *zap.Logger }
type Service ¶
type Service struct { Messages *repositories.MessagesRepository HashingTask *HashingTask PushSvc *push.Service Logger *zap.Logger // contains filtered or unexported fields }
func NewService ¶
func NewService(params ServiceParams) *Service
func (*Service) Enqeue ¶
func (s *Service) Enqeue(device models.Device, message smsgateway.Message, opts EnqueueOptions) (smsgateway.MessageState, error)
func (*Service) GetState ¶
func (s *Service) GetState(user models.User, ID string) (smsgateway.MessageState, error)
func (*Service) RunBackgroundTasks ¶
func (*Service) SelectPending ¶
func (s *Service) SelectPending(deviceID string) ([]smsgateway.Message, error)
func (*Service) UpdateState ¶
func (s *Service) UpdateState(deviceID string, message smsgateway.MessageState) error
type ServiceParams ¶
type ServiceParams struct { fx.In IDGen db.IDGen Messages *repositories.MessagesRepository HashingTask *HashingTask PushSvc *push.Service Logger *zap.Logger }
Click to show internal directories.
Click to hide internal directories.