Documentation ¶
Index ¶
- Constants
- func Disconnect() error
- func InitPostgresDB(cfg *PostgresSQLConfig) error
- type Log
- type LogRepository
- type LogRepositoryImpl
- type PostgresDB
- func (db *PostgresDB) GetRefillableCardByUser(user *models.User) (*RefillableCardDBRow, error)
- func (db *PostgresDB) GetRefillableCardByUserID(userId uuid.UUID) (*RefillableCardDBRow, error)
- func (db *PostgresDB) InsertNewRefillableCard(card *models.RefillableCard) (*RefillableCardDBRow, error)
- func (db *PostgresDB) InsertOrUpdateRefillableCard(card *models.RefillableCard) (isUpdated bool, err error)
- func (db *PostgresDB) UpdateRefillableCardInfo(card *models.RefillableCard) (*RefillableCardDBRow, error)
- type PostgresSQLConfig
- type Query
- type RefillableCardDBRow
Constants ¶
View Source
const ( Insert = iota + 1 Select Update Delete )
Variables ¶
This section is empty.
Functions ¶
func Disconnect ¶
func Disconnect() error
func InitPostgresDB ¶
func InitPostgresDB(cfg *PostgresSQLConfig) error
InitPostgresDB initializes a new instance of the Database.
Types ¶
type Log ¶
type LogRepository ¶
func NewLogRepository ¶
func NewLogRepository(db *PostgresDB) LogRepository
type LogRepositoryImpl ¶
type LogRepositoryImpl struct {
// contains filtered or unexported fields
}
func (*LogRepositoryImpl) InsertLog ¶
func (l *LogRepositoryImpl) InsertLog(log *Log) error
type PostgresDB ¶
func GetDB ¶
func GetDB() (*PostgresDB, bool)
func (*PostgresDB) GetRefillableCardByUser ¶
func (db *PostgresDB) GetRefillableCardByUser(user *models.User) (*RefillableCardDBRow, error)
func (*PostgresDB) GetRefillableCardByUserID ¶
func (db *PostgresDB) GetRefillableCardByUserID(userId uuid.UUID) (*RefillableCardDBRow, error)
func (*PostgresDB) InsertNewRefillableCard ¶
func (db *PostgresDB) InsertNewRefillableCard(card *models.RefillableCard) (*RefillableCardDBRow, error)
func (*PostgresDB) InsertOrUpdateRefillableCard ¶
func (db *PostgresDB) InsertOrUpdateRefillableCard(card *models.RefillableCard) (isUpdated bool, err error)
func (*PostgresDB) UpdateRefillableCardInfo ¶
func (db *PostgresDB) UpdateRefillableCardInfo(card *models.RefillableCard) ( *RefillableCardDBRow, error)
type PostgresSQLConfig ¶
type PostgresSQLConfig struct { DBHost string DBPort string DBUsername string DBPassword string DBName string DBSSLMode string }
func LoadConfig ¶
func LoadConfig() (*PostgresSQLConfig, error)
type RefillableCardDBRow ¶
type RefillableCardDBRow struct { Id int `json:"id"` UserId string `json:"user_id"` CardSynonym string `json:"card_synonym"` CardMask string `json:"card_mask"` }
func (*RefillableCardDBRow) RefillableCardDBRowToCardRecord ¶
func (c *RefillableCardDBRow) RefillableCardDBRowToCardRecord() (*models.RefillableCard, error)
Click to show internal directories.
Click to hide internal directories.