repository

package
v0.0.0-...-7acbcea Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresDB

func NewPostgresDB(ctx context.Context, maxAttempts uint8, cfg Config, logger *PostgresLogger) (pool *pgxpool.Pool, err error)

func RegenerateIndexes

func RegenerateIndexes(ctx context.Context, pool *pgxpool.Pool)

Types

type Auth

type Auth interface {
	SignUp(ctx context.Context, dto models.UserSingUpDTO) (int, error)
	SingIn(ctx context.Context, dto models.UserSignInDTO) (int, error)
	Refresh(ctx context.Context, id int, password string) error
}

type AuthPostgres

type AuthPostgres struct {
	logger.Logger
	*pgxpool.Pool
}

func NewAuthPostgres

func NewAuthPostgres(pool *pgxpool.Pool, logger logger.Logger) *AuthPostgres

func (*AuthPostgres) Refresh

func (a *AuthPostgres) Refresh(ctx context.Context, id int, password string) error

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 Chat

type Chat interface {
	CreateChat(ctx context.Context, dto models.ChatCreateDTO) (int, error)
	AddMembers(ctx context.Context, userId int, dto models.ChatAddMemberDTO) error
	RemoveMembers(ctx context.Context, userId int, dto models.ChatRemoveMemberDTO) error
}

type ChatPostgres

type ChatPostgres struct {
	logger.Logger
	*pgxpool.Pool
}

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 Config

type Config struct {
	Host     string
	Port     string
	UserName string
	UserPass string
	DBName   string
	SSLMode  string
}

type Message

type Message interface {
}

type PostgresLogger

type PostgresLogger struct {
	logger.Logger
}

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

type Repository struct {
	Auth
	User
	Message
	Chat
}

func NewRepository

func NewRepository(pool *pgxpool.Pool, logger logger.Logger) *Repository

type User

type User interface {
}

Jump to

Keyboard shortcuts

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