Documentation ¶
Index ¶
- Constants
- Variables
- type AuthService
- func (s *AuthService) AuthorizeDevice(token string) (models.Device, error)
- func (s *AuthService) AuthorizeUser(username, password string) (models.User, error)
- func (s *AuthService) RegisterDevice(userID string, name, pushToken *string) (models.Device, error)
- func (s *AuthService) RegisterUser(login, password string) (models.User, error)
- func (s *AuthService) UpdateDevice(id, pushToken string) error
- type MessagesService
- func (s *MessagesService) Enqeue(device models.Device, message smsgateway.Message) (smsgateway.MessageState, error)
- func (s *MessagesService) GetState(user models.User, ID string) (smsgateway.MessageState, error)
- func (s *MessagesService) SelectPending(deviceID string) ([]smsgateway.Message, error)
- func (s *MessagesService) UpdateState(deviceID string, message smsgateway.MessageState) error
- type PushService
- type PushServiceConfig
Constants ¶
View Source
const (
ErrorTTLExpired = "TTL expired"
)
Variables ¶
View Source
var ErrValidation error = errors.New("validation error")
View Source
var Module = fx.Module( "services", fx.Provide( NewAuthService, NewMessagesService, NewPushService, ), )
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(users *repositories.UsersRepository, devices *repositories.DevicesRepository) *AuthService
func (*AuthService) AuthorizeDevice ¶
func (s *AuthService) AuthorizeDevice(token string) (models.Device, error)
func (*AuthService) AuthorizeUser ¶
func (s *AuthService) AuthorizeUser(username, password string) (models.User, error)
func (*AuthService) RegisterDevice ¶
func (*AuthService) RegisterUser ¶
func (s *AuthService) RegisterUser(login, password string) (models.User, error)
func (*AuthService) UpdateDevice ¶
func (s *AuthService) UpdateDevice(id, pushToken string) error
type MessagesService ¶
type MessagesService struct { Messages *repositories.MessagesRepository PushSvc *PushService // contains filtered or unexported fields }
func NewMessagesService ¶
func NewMessagesService(pushSvc *PushService, messages *repositories.MessagesRepository) *MessagesService
func (*MessagesService) Enqeue ¶
func (s *MessagesService) Enqeue(device models.Device, message smsgateway.Message) (smsgateway.MessageState, error)
func (*MessagesService) GetState ¶
func (s *MessagesService) GetState(user models.User, ID string) (smsgateway.MessageState, error)
func (*MessagesService) SelectPending ¶
func (s *MessagesService) SelectPending(deviceID string) ([]smsgateway.Message, error)
func (*MessagesService) UpdateState ¶
func (s *MessagesService) UpdateState(deviceID string, message smsgateway.MessageState) error
type PushService ¶
type PushService struct { CredentialsJSON string // contains filtered or unexported fields }
func NewPushService ¶
func NewPushService(config PushServiceConfig) *PushService
type PushServiceConfig ¶
type PushServiceConfig struct {
CredentialsJSON string
}
Click to show internal directories.
Click to hide internal directories.