Documentation ¶
Index ¶
- func NewPostgresDB(ctx context.Context, maxAttempts uint8, cfg Config, logger *PostgresLogger) (pool *pgxpool.Pool, err error)
- func RegenerateIndexes(ctx context.Context, pool *pgxpool.Pool)
- type Auth
- type AuthPostgres
- type Chat
- type ChatPostgres
- func (c *ChatPostgres) AddMembers(ctx context.Context, userId int, dto models.ChatAddMemberDTO) error
- func (c *ChatPostgres) CreateChat(ctx context.Context, dto models.ChatCreateDTO) (int, error)
- func (c *ChatPostgres) RemoveMembers(ctx context.Context, userId int, dto models.ChatRemoveMemberDTO) error
- type Config
- type Message
- type PostgresLogger
- type Repository
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresDB ¶
Types ¶
type AuthPostgres ¶
func NewAuthPostgres ¶
func NewAuthPostgres(pool *pgxpool.Pool, logger logger.Logger) *AuthPostgres
func (*AuthPostgres) SignUp ¶
func (a *AuthPostgres) SignUp(ctx context.Context, dto models.UserSingUpDTO) (int, error)
func (*AuthPostgres) SingIn ¶
func (a *AuthPostgres) SingIn(ctx context.Context, dto models.UserSignInDTO) (int, error)
type ChatPostgres ¶
func NewChatPostgres ¶
func NewChatPostgres(logger logger.Logger, pool *pgxpool.Pool) *ChatPostgres
func (*ChatPostgres) AddMembers ¶
func (c *ChatPostgres) AddMembers(ctx context.Context, userId int, dto models.ChatAddMemberDTO) error
func (*ChatPostgres) CreateChat ¶
func (c *ChatPostgres) CreateChat(ctx context.Context, dto models.ChatCreateDTO) (int, error)
func (*ChatPostgres) RemoveMembers ¶
func (c *ChatPostgres) RemoveMembers(ctx context.Context, userId int, dto models.ChatRemoveMemberDTO) error
type PostgresLogger ¶
func NewPostgresLogger ¶
func NewPostgresLogger(logger logger.Logger) *PostgresLogger
func (*PostgresLogger) TraceQueryEnd ¶
func (l *PostgresLogger) TraceQueryEnd(_ context.Context, _ *pgx.Conn, data pgx.TraceQueryEndData)
func (*PostgresLogger) TraceQueryStart ¶
func (l *PostgresLogger) TraceQueryStart(ctx context.Context, _ *pgx.Conn, data pgx.TraceQueryStartData) context.Context
type Repository ¶
func NewRepository ¶
func NewRepository(pool *pgxpool.Pool, logger logger.Logger) *Repository
Click to show internal directories.
Click to hide internal directories.