postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnPool

func NewConnPool(conf config.Postgres) (*pgxpool.Pool, error)

Types

type DialogRepository

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

func NewDialogRepository

func NewDialogRepository(pool *pgxpool.Pool) *DialogRepository

func (*DialogRepository) Create

func (r *DialogRepository) Create(ctx context.Context, dialog *entity.Dialog) error

func (*DialogRepository) GetByID

func (r *DialogRepository) GetByID(ctx context.Context, dialogID int) (entity.Dialog, error)

func (*DialogRepository) List

func (r *DialogRepository) List(ctx context.Context) ([]entity.Dialog, error)

func (*DialogRepository) Update

func (r *DialogRepository) Update(ctx context.Context, dialog *entity.Dialog) error

type GroupParticipantRepository

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

func NewGroupParticipantRepository

func NewGroupParticipantRepository(pool *pgxpool.Pool) *GroupParticipantRepository

func (*GroupParticipantRepository) Create

func (*GroupParticipantRepository) Get

func (r *GroupParticipantRepository) Get(ctx context.Context, groupID, userID int, withLock bool) (entity.GroupParticipant, error)

func (*GroupParticipantRepository) List

func (*GroupParticipantRepository) Update

type GroupRepository

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

func NewGroupRepository

func NewGroupRepository(pool *pgxpool.Pool) *GroupRepository

func (*GroupRepository) Create

func (r *GroupRepository) Create(ctx context.Context, group *entity.Group) error

func (*GroupRepository) Delete

func (r *GroupRepository) Delete(ctx context.Context, groupID int) error

func (*GroupRepository) GetByID

func (r *GroupRepository) GetByID(ctx context.Context, groupID int) (entity.Group, error)

func (*GroupRepository) List

func (r *GroupRepository) List(ctx context.Context) ([]entity.Group, error)

func (*GroupRepository) Update

func (r *GroupRepository) Update(ctx context.Context, group *entity.Group) error

type MessageRepository

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

func NewMessageRepository

func NewMessageRepository(pool *pgxpool.Pool) *MessageRepository

func (*MessageRepository) Create

func (r *MessageRepository) Create(ctx context.Context, message *entity.Message) error

func (*MessageRepository) List

type TransactionManager

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

func NewTransactionManager

func NewTransactionManager(pool *pgxpool.Pool) *TransactionManager

func (*TransactionManager) Do

func (txm *TransactionManager) Do(ctx context.Context, fn func(ctx context.Context) error) error

type UserRepository

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

func NewUserRepository

func NewUserRepository(pool *pgxpool.Pool) *UserRepository

func (*UserRepository) Create

func (r *UserRepository) Create(ctx context.Context, user *entity.User) error

func (*UserRepository) Delete

func (r *UserRepository) Delete(ctx context.Context, id int) error

func (*UserRepository) GetByID

func (r *UserRepository) GetByID(ctx context.Context, id int) (entity.User, error)

func (*UserRepository) GetByUsername

func (r *UserRepository) GetByUsername(ctx context.Context, username string) (entity.User, error)

func (*UserRepository) List

func (r *UserRepository) List(ctx context.Context) ([]entity.User, error)

func (*UserRepository) Update

func (r *UserRepository) Update(ctx context.Context, user *entity.User) error

func (*UserRepository) UpdatePassword

func (r *UserRepository) UpdatePassword(ctx context.Context, userID int, pwdHash string) error

Jump to

Keyboard shortcuts

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