repositories

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 MessagesSelectOptions struct {
	WithRecipients bool
	WithDevice     bool
	WithStates     bool
}

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)

func (*UsersRepository) Insert

func (r *UsersRepository) Insert(user *models.User) error

Jump to

Keyboard shortcuts

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