services

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorTTLExpired = "TTL expired"
)

Variables

Functions

This section is empty.

Types

type AuthService

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

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 (s *AuthService) RegisterDevice(userID string, name, pushToken *string) (models.Device, error)

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 ErrValidation

type ErrValidation string

func (ErrValidation) Error added in v1.4.0

func (e ErrValidation) Error() string

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 (*MessagesService) GetState

func (s *MessagesService) GetState(user models.User, ID string) (smsgateway.MessageState, error)

func (*MessagesService) HashProcessed added in v1.4.0

func (s *MessagesService) HashProcessed() 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

func (*PushService) Send

func (s *PushService) Send(ctx context.Context, token string, data map[string]string) error

send

type PushServiceConfig

type PushServiceConfig struct {
	CredentialsJSON string
}

Jump to

Keyboard shortcuts

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