Documentation
¶
Index ¶
- type PostgresDriver
- func (p *PostgresDriver) Close() error
- func (p *PostgresDriver) Connect() error
- func (p *PostgresDriver) DeleteUserData(accountID string) error
- func (p *PostgresDriver) GetUserData(accountID string) (string, time.Time, error)
- func (p *PostgresDriver) InsertUserData(accountID string, data string) error
- func (p *PostgresDriver) Migrate() error
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresDriver ¶
type PostgresDriver struct {
// External data
DbHost string
DbPort int
DbUser string
DbPass string
DbName string
// Internal data
Db *gorm.DB
}
func NewPostgresDriver ¶
func NewPostgresDriver(host string, port int, user string, pass string, dbName string, logger zerolog.Logger) *PostgresDriver
NewPostgresDriver creates a new instance of PostgresDriver
func (*PostgresDriver) Close ¶
func (p *PostgresDriver) Close() error
Close closes the connection to the database
func (*PostgresDriver) Connect ¶
func (p *PostgresDriver) Connect() error
Connect establishes a connection to the database
func (*PostgresDriver) DeleteUserData ¶
func (p *PostgresDriver) DeleteUserData(accountID string) error
DeleteUserData deletes a user data record from the database
func (*PostgresDriver) GetUserData ¶
GetUserData retrieves a user data record from the database
func (*PostgresDriver) InsertUserData ¶
func (p *PostgresDriver) InsertUserData(accountID string, data string) error
InsertUserData inserts a new user data record into the database
func (*PostgresDriver) Migrate ¶
func (p *PostgresDriver) Migrate() error
Migrate the schema to database
Click to show internal directories.
Click to hide internal directories.