Documentation ¶
Index ¶
- Constants
- Variables
- type MessagesRepository
- func (r *MessagesRepository) Get(ID string, filter MessagesSelectFilter, options ...MessagesSelectOptions) (message models.Message, err error)
- func (r *MessagesRepository) HashProcessed(ids []uint64) error
- func (r *MessagesRepository) Insert(message *models.Message) error
- func (r *MessagesRepository) SelectPending(deviceID string) (messages []models.Message, err error)
- func (r *MessagesRepository) UpdateState(message *models.Message) error
- type MessagesSelectFilter
- type MessagesSelectOptions
- type UsersRepository
Constants ¶
View Source
const HashingLockName = "36444143-1ace-4dbf-891c-cc505911497e"
Variables ¶
View Source
var ErrMessageAlreadyExists = errors.New("duplicate id")
View Source
var ErrMessageNotFound = gorm.ErrRecordNotFound
View Source
var (
ErrUserNotFound = gorm.ErrRecordNotFound
)
View Source
var Module = fx.Module( "repositories", fx.Decorate(func(log *zap.Logger) *zap.Logger { return log.Named("repositories") }), fx.Provide( NewMessagesRepository, NewUsersRepository, ), )
Functions ¶
This section is empty.
Types ¶
type MessagesRepository ¶
type MessagesRepository struct {
// contains filtered or unexported fields
}
func NewMessagesRepository ¶
func NewMessagesRepository(db *gorm.DB) *MessagesRepository
func (*MessagesRepository) Get ¶
func (r *MessagesRepository) Get(ID string, filter MessagesSelectFilter, options ...MessagesSelectOptions) (message models.Message, err error)
func (*MessagesRepository) HashProcessed ¶ added in v1.4.0
func (r *MessagesRepository) HashProcessed(ids []uint64) error
func (*MessagesRepository) Insert ¶
func (r *MessagesRepository) Insert(message *models.Message) error
func (*MessagesRepository) SelectPending ¶
func (r *MessagesRepository) SelectPending(deviceID string) (messages []models.Message, err error)
func (*MessagesRepository) UpdateState ¶
func (r *MessagesRepository) UpdateState(message *models.Message) error
type MessagesSelectFilter ¶
type MessagesSelectFilter struct {
DeviceID string
}
/////////////////////////////////////////////////////////////////////////////
type MessagesSelectOptions ¶
type UsersRepository ¶
type UsersRepository struct {
// contains filtered or unexported fields
}
func NewUsersRepository ¶
func NewUsersRepository(db *gorm.DB) *UsersRepository
func (*UsersRepository) GetByLogin ¶
func (r *UsersRepository) GetByLogin(login string) (models.User, error)
Click to show internal directories.
Click to hide internal directories.